✨ Support more convenient inject js css
This commit is contained in:
14
dist/cli.js
vendored
14
dist/cli.js
vendored
@@ -135,7 +135,7 @@ var windows = [
|
||||
dark_mode: false,
|
||||
activation_shortcut: "",
|
||||
disabled_web_shortcuts: false,
|
||||
hide_on_close: false
|
||||
hide_on_close: true
|
||||
}
|
||||
];
|
||||
var user_agent = {
|
||||
@@ -785,6 +785,7 @@ const DEFAULT_PAKE_OPTIONS = {
|
||||
height: 780,
|
||||
width: 1200,
|
||||
fullscreen: false,
|
||||
resizable: true,
|
||||
hideTitleBar: false,
|
||||
alwaysOnTop: false,
|
||||
appVersion: '1.0.0',
|
||||
@@ -992,7 +993,16 @@ program
|
||||
.option('--fullscreen', 'Start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
|
||||
.option('--hide-title-bar', 'For Mac, hide title bar', DEFAULT_PAKE_OPTIONS.hideTitleBar)
|
||||
.option('--multi-arch', 'For Mac, both Intel and M1', DEFAULT_PAKE_OPTIONS.multiArch)
|
||||
.option('--inject <url...>', 'Injection of .js or .css files', DEFAULT_PAKE_OPTIONS.inject)
|
||||
.option('--inject <./style.css,./script.js,...>', 'Injection of .js or .css files', (val, previous) => {
|
||||
if (!val)
|
||||
return DEFAULT_PAKE_OPTIONS.inject;
|
||||
// Split by comma and trim whitespace, filter out empty strings
|
||||
const files = val.split(',')
|
||||
.map(item => item.trim())
|
||||
.filter(item => item.length > 0);
|
||||
// If previous values exist (from multiple --inject options), merge them
|
||||
return previous ? [...previous, ...files] : files;
|
||||
}, DEFAULT_PAKE_OPTIONS.inject)
|
||||
.option('--debug', 'Debug build and more output', DEFAULT_PAKE_OPTIONS.debug)
|
||||
.addOption(new Option('--proxy-url <url>', 'Proxy URL for all network requests').default(DEFAULT_PAKE_OPTIONS.proxyUrl).hideHelp())
|
||||
.addOption(new Option('--user-agent <string>', 'Custom user agent').default(DEFAULT_PAKE_OPTIONS.userAgent).hideHelp())
|
||||
|
||||
Reference in New Issue
Block a user