gluon: pass env variables as variables instead of replacing them in the string (#1)
* Pass env variables as variables instead of replacing them in the string * Declare as variables instead of passing
This commit is contained in:
parent
e0d1befb65
commit
4290f54981
@ -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 });
|
||||
};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user