|
阅读:5302回复:9
【已解决】在Firefox 94.0 beta版本中,如何设置右键图片“新建标签页打开图像”为前台打开
在Firefox 94.0 beta版本中
如何设置右键图片“新建标签页打开图像”为前台打开,现在默认是后台打开 请大神@lonely_8 帮忙,万分感谢! 图片:2021-10-11_13292325.jpg |
|
|
1楼#
发布于:2021-10-12 16:16
browser.tabs.loadInBackground 改为 false
|
|
|
2楼#
发布于:2021-10-13 23:30
location.href == 'chrome://browser/content/browser.xhtml' && setTimeout(function() {
const viewImage = document.getElementById('context-viewimage');
if(!viewImage) return;
viewImage.removeAttribute('oncommand');
viewImage.addEventListener('command', function (e) {
let where = whereToOpenLink(e, false, false);
if (where == "current") {
where = "tab";
}
let referrerInfo = gContextMenu.contentData.referrerInfo;
let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
if (gContextMenu.onCanvas) {
gContextMenu._canvasToBlobURL(gContextMenu.targetIdentifier).then(function(blobURL) {
openLinkIn(blobURL, where, {
referrerInfo,
triggeringPrincipal: systemPrincipal,
inBackground: e.button !== 0
});
}, Cu.reportError);
} else {
urlSecurityCheck(
gContextMenu.mediaURL,
gContextMenu.principal,
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT
);
// Default to opening in a new tab.
openLinkIn(gContextMenu.mediaURL, where, {
referrerInfo,
forceAllowDataURI: true,
triggeringPrincipal: gContextMenu.principal,
csp: gContextMenu.csp,
inBackground: e.button !== 0
});
}
});
}, 1000);UC 脚本,左键为前台标签打开,中键、右键则为后台标签打开。 |
|
|
3楼#
发布于:2021-10-14 08:03
|
|
|
4楼#
发布于:2021-10-24 11:15
|
|
|
5楼#
发布于:2021-10-24 14:55
|
|
|
6楼#
发布于:2021-10-24 16:45
|
|
|
7楼#
发布于:2021-10-24 16:52
lonely_8:测试并没有问题。回到原帖在95版下这两个脚本也失效了,可以修复?谢谢!!! // 03. 主页按钮在新标签打开
(function() {
// 新标签打开:主页按钮(排除about:blank和about:newtab)
try {
eval("BrowserHome = " + BrowserHome.toString()
.replace(/switch \(where\) {/, "where = (gBrowser.currentURI.spec!="+"'about:blank' && gBrowser.currentURI.spec!="+"'about:newtab' || gBrowser.webProgress.isLoadingDocument"+") ? 'tab' : 'current'; $&"));
}catch(e){}
})();// 05. 重新载入全部标签页
location.href.startsWith('chrome://browser/content/browser.x') && (() => {
const reloadTab = document.getElementById('context_reloadTab');
if(!reloadTab) return;
const menuitem = document.createXULElement('menuitem');
menuitem.setAttribute('accesskey', 'A');
menuitem.setAttribute('label', reloadTab.getAttribute('label')
.startsWith('Reload') ? 'Reload All Tabs' : '重新载入全部标签页'
);
menuitem.addEventListener('command', () => {
gBrowser.visibleTabs.forEach(tab => {
try {
gBrowser.getBrowserForTab(tab).reload();
} catch (e) {}
});
});
reloadTab.after(menuitem);
})(); |
|
|
8楼#
发布于:2021-10-24 20:50
都没问题,我怀疑你都没正常加载脚本。
|
|
|
9楼#
发布于:2021-10-24 20:59
|
|
