mirror of
https://github.com/zotero/zotero.git
synced 2026-09-14 23:21:03 +00:00
Prompt to enable remote debugging if disabled
This commit is contained in:
parent
7ee3c424fc
commit
2e9d7db0e8
1 changed files with 20 additions and 0 deletions
|
|
@ -962,6 +962,26 @@ function toJavaScriptConsole() {
|
|||
}
|
||||
|
||||
function launchDeveloperToolbox() {
|
||||
let prefs = ['devtools.chrome.enabled', 'devtools.debugger.remote-enabled'];
|
||||
let enabled = prefs.every(pref => !!Zotero.Prefs.get(pref, true));
|
||||
if (!enabled) {
|
||||
let ps = Services.prompt;
|
||||
let shouldEnable = ps.confirm(
|
||||
null,
|
||||
'Remote Debugging Disabled',
|
||||
'Enable remote debugging? This will allow Firefox instances on this machine to control ' + Zotero.appName + '.'
|
||||
+ '\n\nThis is inherently a security risk and is NOT RECOMMENDED for normal use.'
|
||||
);
|
||||
if (shouldEnable) {
|
||||
for (let pref of prefs) {
|
||||
Zotero.Prefs.set(pref, true, /* global */ true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const { BrowserToolboxLauncher } = ChromeUtils.import("resource://devtools/client/framework/browser-toolbox/Launcher.jsm");
|
||||
// Don't launch if already open
|
||||
// (Can we focus the existing toolbox process?)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue