begriffs / css-ratiocinator

because your CSS is garbage
MIT License
1.04k stars 49 forks source link

Where my css is generated? #48

Closed suissa closed 11 years ago

suissa commented 11 years ago

I'm trying in some css but don't throw any error and dont generate any css.

My command: phantomjs ratiocinate.js http://javascriptbrasil.com/wp-content/plugins/crayon-syntax-highlighter/themes/classic/classic.css

agats commented 11 years ago

Hi suissa,

css-ratiocinator is expecting a html file and in your command it is passing a css file.

Try this command phantomjs ratiocinate.js http://javascriptbrasil.com/

suissa commented 11 years ago

Oh sorry! I tried with other site and returns an error, but whe i tried with google.com worked.

//javascriptbrasil.com/
^C% css-ratiocinator|master⚡ ⇒ phantomjs ratiocinate.js http://fri.la
TypeError: 'undefined' is not an object (evaluating '$.lr.api')

http://signup.fri.la/ignition-current.min.js:246 http://signup.fri.la/ignition-current.min.js:253 vendor/jquery-1.8.2.js:605 http://signup.fri.la/ignition-current.min.js:253 http://signup.fri.la/ignition-current.min.js:253 http://signup.fri.la/ignition-current.min.js:249 http://signup.fri.la/ignition-current.min.js:245 http://signup.fri.la/ignition-current.min.js:245 http://signup.fri.la/ignition-current.min.js:245 http://signup.fri.la/ignition-current.min.js:244 ^C% css-ratiocinator|master⚡ ⇒ phantomjs ratiocinate.js htt

agats commented 11 years ago

I tried opening http://javascriptbrasil.com with just phantomjs. And it looks like phantomjs was able to open the page.

Here is what I did, -Created a file debugging.js

console.log('Loading a web page');
var page = require('webpage').create();
var url = 'http://javascriptbrasil.com/';
debugger;
page.open(url, function (status) {
    debugger;
    //Page is loaded!
    phantom.exit();
});

-And ran the command phantomjs --remote-debugger-port-9000 debugging.js

-Opened the phantomjs debugger in Chrome

begriffs commented 11 years ago

What OS and phantom version are you using?

Using the domain http://fri.la I reproduced the issue when running ratiocinator on a Heroku instance

However I get no error when I run ratiocinator on my laptop

agats commented 11 years ago

I was also able to reproduce the issue on the domain http://fri.la.

begriffs commented 11 years ago

Looks like the problem was that I was unconditionally inserting a certain version of jQuery which conflicted with what http://fri.la uses. Fixing this issue uncovered another: the page content is loaded with javascript, so we need to wait for the document to finish. I fixed this as well. Pull the newest master and give it a try.