Node webkit and Google OAuth

Just start with node webkit and I just load the site through an iframe to get started ... (I know it's dirty, but it does two-handed work and a little time).

<iframe src="http://somewebsite.com"></iframe> 

The fact is that I have a Google login for a site that creates a popup on the website. For some reason this is not in node-webkit, and I cannot find any document on enabling pop-ups ...

The code I use to sign in to Google is the default value they give us on the site: https://developers.google.com/accounts/docs/OAuth2Login

In configuring node -webkit, I am not installing anything interesting in node:

 "window": { "toolbar": true, "width": 1024, "height": 768, "min_width": 300, "min_height": 300, "position": "center", "resizable": true, "show_in_taskbar": true, "icon": "www/resources/img/icon.png" }, 

So my question is: how do I enable pop-ups in node-webkit from an iframe to get Google OAuth to work? Thanks in advance for your help.

+5
source share
2 answers

I had the same problem and managed to fix it by resolving the node context for remote sites.

Just add the node-remote configuration element to the package.json file. (But be careful, this may cause some libraries to load differently because they will detect a change in context).

 { node-remote : "*" // Or the src url of your iframe } 

After that, Google should work fine.

+1
source

Sicne this was published by "node -remote" has changed a bit. Here is an example:

 "node-remote": "*://*", 

Direct links:

0
source

Source: https://habr.com/ru/post/1200680/


All Articles