Please help to understand how to use inject-js-start / inject-js-end

13 views
Skip to first unread message

anthe...@gmail.com

unread,
Feb 3, 2014, 12:10:50 AM2/3/14
to node-...@googlegroups.com
Maybe I misunderstand the documentation.
I create a file inject.js containing code console.log('injected');  And put it next to package.json. Added option to package.json:

  "window": {
   "inject-js-end": "inject.js",

But it does not work. I need to inject javascript code into all iframes that I create on the page. How to do it?

crstoth

unread,
Feb 7, 2014, 4:26:11 PM2/7/14
to node-...@googlegroups.com, anthe...@gmail.com
I haven't tried it with the package.json, but it works great using Window.open() as property of the options parameter.

It inserts the specified file in the specified URL in Window.open() and any other URLs you open in that Window and any of it's child frames (including iframes). 

anthe...@gmail.com

unread,
Feb 8, 2014, 11:48:56 AM2/8/14
to node-...@googlegroups.com, anthe...@gmail.com, chris...@gmail.com
thank, but Window.open() no good for me. Ideally, i want (to test pages in a site) run separate processes of node-webkit with disabled node, as a browser. And inject scripts.


Reply all
Reply to author
Forward
0 new messages