Skip to content

Commit 5265891

Browse files
committed
Fix nwjs#7320: window.open does not load inject_js_start or inject_js_end when opening the page
1 parent 0f32540 commit 5265891

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/browser/nw_extensions_browser_hooks.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ std::unique_ptr<base::DictionaryValue> MergeManifest() {
152152
// merge with default `window` manifest in package.json if exists
153153
nw::Package* pkg = nw::package();
154154
if (pkg) {
155+
std::string js_doc_start, js_doc_end;
156+
pkg->root()->GetString(::switches::kmInjectJSDocStart, &js_doc_start);
157+
if (!js_doc_start.empty())
158+
manifest->SetString(::switches::kmInjectJSDocStart, js_doc_start);
159+
pkg->root()->GetString(::switches::kmInjectJSDocEnd, &js_doc_end);
160+
if (!js_doc_end.empty())
161+
manifest->SetString(::switches::kmInjectJSDocEnd, js_doc_end);
155162
base::DictionaryValue* manifest_window = pkg->window();
156163
if (manifest_window) {
157164
std::unique_ptr<base::DictionaryValue> manifest_window_cloned = manifest_window->DeepCopyWithoutEmptyChildren();

0 commit comments

Comments
 (0)