[webkit-dev] How to make "window.open" inherit objects form the opener?

Zhao Cheng zcbenz at gmail.com
Thu Sep 6 18:51:20 PDT 2012

Hi webkit-dev,

What I'm doing is integrating node.js with Chromium, one step is to
insert all objects from node's "global" object into the "window"
object. I made it by hacking into the
"V8DOMWindowShell::initializeIfNeeded" function in WebKit's
V8 binding code and set all node's global objects as
members of the "m_global" object after DOM window is installed.

This method worked great until I opened a new window by calling
"window.open", the node.js's symbols were all lost in the new window. As
I read from limited documents from WebKit and Chromium, "window.open"
doesn't open new renderer process and reuses the opener's DOM object,
so I guess my code in "V8DOMWindowShell::initializeIfNeeded" was not
executed in the window opened by "window.open".

Is there a way to make the window opened by "window.open" inherit
my custom global objects in the opener? Any help is appreciated since
this problem has haunted me for a long time.

Intel Open Source Technology Center

More information about the webkit-dev mailing list