diff --git a/gluon/index.js b/gluon/index.js index e4b0b18..4ed229a 100644 --- a/gluon/index.js +++ b/gluon/index.js @@ -85,14 +85,14 @@ export const open = async (url, onLoad = () => {}) => { const toRun = `(() => { if (window.self !== window.top) return; // inside frame - (${onLoad.toString() - .replaceAll('GLUON_VERSION', process.versions.gluon) - .replaceAll('CHROMIUM_VERSION', '${navigator.userAgentData.brands.find(x => x.brand === \'Chromium\').version}') - .replaceAll('NODE_VERSION', process.versions.node)})(); + const GLUON_VERSION = ${process.versions.gluon}; + const CHROMIUM_VERSION = navigator.userAgentData.brands.find(x => x.brand === "Chromium").version; + const NODE_VERSION = ${process.versions.node}; + (${onLoad.toString()})(); })()`; run(toRun); await Page.enable(); await Page.addScriptToEvaluateOnNewDocument({ source: toRun }); -}; \ No newline at end of file +};