sliccy 1.0.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -113,7 +113,10 @@ export function buildElectronOverlayInjectionCall(options) {
|
|
|
113
113
|
if (options.activeTab) {
|
|
114
114
|
payload['activeTab'] = options.activeTab;
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
// Wait for document.body before injecting — Runtime.evaluate and
|
|
117
|
+
// addScriptToEvaluateOnNewDocument can fire before the DOM is ready.
|
|
118
|
+
const call = `window.__SLICC_ELECTRON_OVERLAY__?.inject(${JSON.stringify(payload)});`;
|
|
119
|
+
return `if(document.body){${call}}else{document.addEventListener('DOMContentLoaded',function(){${call}});}`;
|
|
117
120
|
}
|
|
118
121
|
export function buildElectronOverlayBootstrapScript(options) {
|
|
119
122
|
return `${options.bundleSource}\n${buildElectronOverlayInjectionCall(options)}`;
|