Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ajchemist opened this issue Jun 23, 2015 · 8 comments
Open

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

ajchemist opened this issue Jun 23, 2015 · 8 comments

Comments

@ajchemist
Copy link

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
Copy link
Contributor

Inviz commented Jun 23, 2015

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
Copy link

Gi972 commented Jul 5, 2015

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
Copy link
Contributor

Inviz commented Jul 10, 2015

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

@Gi972
Copy link

Gi972 commented Jul 15, 2015

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

@Inviz
Copy link
Contributor

Inviz commented Jul 15, 2015

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
Copy link

I have the same issue :/

@eikooc
Copy link

eikooc commented Nov 25, 2015

+1 for external stylesheet not working

@xooxdoo
Copy link

xooxdoo commented Aug 30, 2016

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")
  // ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants