Compare commits

...

4 Commits

3
src/bootstrap.js vendored

@ -41,7 +41,8 @@ const startCore = () => {
bw.webContents.executeJavaScript(readFileSync(join(__dirname, 'mainWindow.js'), 'utf8')
.replaceAll('<hash>', hash).replaceAll('<channel>', channel)
.replaceAll('<notrack>', oaConfig.noTrack)
.replaceAll('<notrack>', oaConfig.noTrack !== false)
.replaceAll('<domopt>', oaConfig.domOptimizer !== false)
.replace('<css>', (oaConfig.css ?? '').replaceAll('\\', '\\\\').replaceAll('`', '\\`')));
if (oaConfig.js) bw.webContents.executeJavaScript(oaConfig.js);

@ -9,7 +9,7 @@ const presets = {
module.exports = () => {
let c = {};
for (const x of ('base,' + (oaConfig.cmdPreset || 'perf')).split(',').reduce((a, x) => a.concat(presets[x]?.split(' ')), [])) {
for (const x of ('base,' + (oaConfig.cmdPreset || 'perf')).split(',').reduce((a, x) => a.concat(presets[x]?.split(' '))).concat((oaConfig.customFlags ?? '').split(' '))) {
if (!x) continue;
const [ k, v ] = x.split('=');

@ -79,5 +79,7 @@ const optimize = orig => function(...args) {
return orig.apply(this, args);
};
Element.prototype.removeChild = optimize(Element.prototype.removeChild);
// Element.prototype.appendChild = optimize(Element.prototype.appendChild);
if ('<domopt>' === 'true') {
Element.prototype.removeChild = optimize(Element.prototype.removeChild);
// Element.prototype.appendChild = optimize(Element.prototype.appendChild);
}
Loading…
Cancel
Save