gss / engine

GSS engine
http://gss.github.io
MIT License
2.86k stars 105 forks source link

GSS does support electron or nwjs(node-webkit)? #197

Open ajchemist opened 9 years ago

ajchemist commented 9 years ago

I'm working on electron platform.

I've checked gss official helloworld step http://codepen.io/thegridgssdocs/pen/PweaGN works great on common browsers.

But it seems gss doesn't work on electron nor node-webkit either.

Have I missed something?

Inviz commented 9 years ago

We use it with phantomjs 2 and it works good.

http://codepen.io/anon/pen/pJdeqg is this any better? More up to date gss.

Gi972 commented 9 years ago

Hello it works with electron but only in style tag, because when I try with a external link : <link rel="stylesheet/gss" type="text/gss" href="my-awesome-styles.gss"></link> it doesn't load the file . I try without gss in rel attributes like this <link rel="stylesheet" type="text/gss" href="my-awesome-styles.gss"></link> it load the file but the magic don't operate :-(

Have I missed something?

Update: sorry I forget the code ^^

Inviz commented 9 years ago

Try using latest version of gss <script src="http://rawgit.com/gss/document/ranges2/dist/gss.document.parser.js">

Gi972 commented 9 years ago

Hello, I try but same thing it doesn't work

Inviz commented 9 years ago

External stylesheets are loaded with XHR. Do you have COSR access to the path you request with? It also requires web server, as XHR doesnt work over file://. Sorry, I dont know the specifics of those platforms. If there's a ready example that I could download and run, I could try to give it a chance to debug

jhonylucas74 commented 9 years ago

I have the same issue :/

eikooc commented 9 years ago

+1 for external stylesheet not working

xooxdoo commented 8 years ago

The only problem with those platforms, is that they make require available in a browser window, which confuses libraries into thinking they are in node environment, which is not, and the whole thing doesn't work as intended for a browser.

Those platforms are chrome browsers with node js bindings, the problem is those binding is that they run on a separate process, leading to v8 crashes and all of that goodness, but sometimes it all just fails silently.

To resolve this I guess you would have to make the library detect if the environment is truly node, otherwise it should work as in a browser

if (typeof module != null && module.export !== undefined &&  typeof document === "undefined")
  // ...