阅读:6600回复:26
火狐63b4测试版帮忙修复一下脚本谢谢了!keys['Ctrl+Shift+c'] = function(event) { gBrowser.selectedTab = gBrowser.addTab(readFromClipboard());}; //打开剪切板中的网址谢谢大家帮忙修复一下!! |
|
1楼#
发布于:2019-03-21 19:50
UC脚本(关闭标签页后选择左侧标签)在66中有bug
lonely_8:。。刚发现我正则写错了,我在原回复中都改过来了。 //关闭标签页后选择左侧标签 (function () { gBrowser.tabContainer.addEventListener("TabClose", tabCloseHandler, false); function tabCloseHandler(event) { var tab = event.target; gBrowser.selectedTab = tab; if (gBrowser.selectedTab._tPos != 0) { gBrowser.tabContainer.advanceSelectedTab(-1, true); } } })(); 这段UC在64上运行正常,但是在66上运行有bug,具体表现为: 1,连续新建两个newtab再关闭会回到右侧标签 2,第一次启动功能正常,重启火狐后还是会默认选择右侧(UC添加的重启) 3,如果标签都是未读状态关闭标签页还是会回到右侧,如果都是已读状态能正常回到左侧标签页 求大神修复! |
|
2楼#
发布于:2018-12-01 17:15
|
|
3楼#
发布于:2018-12-01 15:26
wenshanliren:非常感谢大神,彻底解决了回到原帖。。刚发现我正则写错了,我在原回复中都改过来了。 /^(f|ht)tps:/ 改为 /^(f|ht)tps?:/ |
|
4楼#
发布于:2018-12-01 15:07
|
|
5楼#
发布于:2018-12-01 13:49
wenshanliren:非常感谢大大的修改,google搜索和以图搜图都可以了,就是站内搜索不行,菜单点击没反应1. var tab = document.popupNode && document.popupNode.localName == "tab" ? document.popupNode : null;替换成 var tab = gBrowser.selectedTab; 2.那天还漏了一个 openNewTabWith(uri.spec);替换成 openNewTabWith(uri.spec, 'tab', { triggeringPrincipal: /^(f|ht)tps?:/.test(uri.spec) ? Services.scriptSecurityManager.createNullPrincipal({}) : Services.scriptSecurityManager.getSystemPrincipal() }); 3.这个改不改都没所谓,从代码上下文来看应该是域名而不是完整地址 case "%H" : return bw.documentURI.spec; case "%HOST%" : return bw.documentURI.spec;替换成 case "%H" : case "%HOST%" : return bw.documentURI.host; |
|
6楼#
发布于:2018-12-01 01:06
|
|
7楼#
发布于:2018-11-30 14:42
wenshanliren:麻烦大神看下,这个脚本怎么修复,_addmenu的这个并不是 _addmenu 这个自定义脚本的错误。 本人没有使用这个脚本,搜索一下应该发现主脚本 AddMenuPlus.uc.js 需要修改。 因为不清楚你使用的是哪一版本的 AddMenuPlus.uc.js 下面的修改是对应 https://github.com/tortious/userChrome.js-userChrome.css-Favorites/blob/a8687515ec7fd94ad6f2fc438de192006ea4ca9e/userChrome.js/AddMenuPlus.uc.js 该脚本的修改。 你可以照着你自己的脚本修改。 (从你的问题来看都是打开链接错误,因为本人不清楚该脚本的全部功能,如还有其它问题我就再找了) 1. loadURI(url)替换成 openUILinkIn(url, 'current', {triggeringPrincipal: gBrowser.selectedBrowser.contentPrincipal}); 2. openUILinkIn(uri.spec, where, false, postData || null)替换成 openUILinkIn(uri.spec, where, { postData: postData || null, triggeringPrincipal: where === 'current' ? gBrowser.selectedBrowser.contentPrincipal : ( /^(f|ht)tps?:/.test(uri.spec) ? Services.scriptSecurityManager.createNullPrincipal({}) : Services.scriptSecurityManager.getSystemPrincipal() ) }); 3. openUILink(uri.spec, event)替换成 openUILink(uri.spec, event, { triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal() }); |
|
8楼#
发布于:2018-11-30 00:28
lonely_8:63 后 gBrowser.addTab 、gBrowser.loadOneTab 之类的要加多一个参数。麻烦大神看下,这个脚本怎么修复,_addmenu的 page({ label: "Google搜索", url: "https://www.google.com/search?q=%s", condition: "select", where:'tab' }); page({ label: "Google站内搜索", url: "https://www.google.com/search?q=site:%HOST%+%SEL%", condition: "select", where:'tab' }); |
|
9楼#
发布于:2018-11-13 14:08
lonely_8:Moz 已经移除了侧边栏打开地址的功能了。昏死,挺好的功能啊怎么就没了 ![]() 有个扩展还可以实现 |
|
10楼#
发布于:2018-11-13 13:16
Moz 已经移除了侧边栏打开地址的功能了。
https://bugzilla.mozilla.org/show_bug.cgi?id=1452645 |
|
11楼#
发布于:2018-11-12 23:19
lonely_8:63 后 gBrowser.addTab 、gBrowser.loadOneTab 之类的要加多一个参数。oncommand:"openWebPanel(gContextMenu.linkText(), gContextMenu.linkURL);", {name: '侧边栏打开当前页', cmd: function(event) { openWebPanel(document.title, gBrowser.currentURI.spec);}}, 又来麻烦大神了,上面两个都是侧边栏打开当前网站的名字,在64+都失效了 ![]() |
|
12楼#
发布于:2018-09-10 22:39
|
|
13楼#
发布于:2018-09-10 21:44
|
|
14楼#
发布于:2018-09-10 21:27
lonely_8:和楼主的失效原因问题一样。亲测有效,谢谢大大的帮忙,但下面这个脚本加上了也没有生效,请问又如何修改呢? // ==UserScript== // @name openLinkByLongPress.uc.js // @description Links in einem neuen Tab öffnen dazu linke Maustaste gedrückt halten // @include main // @version 0.0.1 Fx58 Kompatibel // ==/UserScript== (function() { 'use strict'; if (location != 'chrome://browser/content/browser.xul') { return; } const IN_BACKGROUND = true; // Tab in Hintergrund öffnen const RELATED_TO_CURRENT = true; // Link oder Lesezeichen neben dem aktuellen Tab öffnen? // WAIT = Wartezeit zum Öffnen in einem neuen Tab in Millisekunden let frameScript = function() { const WAIT = 300; let timeoutID; let longPress = false; ['mousedown', 'mouseup', 'dragstart'].forEach(function(type) { addEventListener(type, onClick, true); }); function onClick(event) { if (timeoutID) { clearTimeout(timeoutID); timeoutID = null; } if (event.button !== 0) return; if (event.altKey || event.ctrlKey || event.shiftKey) return; let node = event.target || event.originalTarget; if (!node) return; let url = findLink(node); if (!url) return; if (event.type === 'mousedown') { timeoutID = setTimeout(function() { addEventListener('click', function clk(event) { removeEventListener('click', clk, true); event.preventDefault(); event.stopPropagation(); }, true); sendAsyncMessage('openLinkByLongPress.uc.js', url.href); longPress = true; }, WAIT); } else { clearTimeout(timeoutID); if (longPress && event.type === 'mouseup') { event.preventDefault(); longPress = false; } } } function findLink(node) { if (!node || !node.tagName) { return null; } switch (node.tagName.toUpperCase()) { case 'A': return node; case 'AREA': if (node.href) { return node; } else { return findLink(node.parentNode); }; case 'B': case 'BIG': case 'CODE': case 'DIV': case 'EM': case 'H1': case 'I': case 'IMG': case 'NOBR': case 'P': case 'S': case 'SMALL': case 'SPAN': case 'STRONG': case 'SUB': case 'SUP': return findLink(node.parentNode); default: return null; }; } }; let frameScriptURI = 'data:,(' + frameScript.toString() + ')()'; window.messageManager.loadFrameScript(frameScriptURI, true); window.messageManager.addMessageListener('openLinkByLongPress.uc.js', function(message) { gBrowser.loadOneTab(message.data, { triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}), relatedToCurrent: RELATED_TO_CURRENT, inBackground: IN_BACKGROUND, referrerURI: makeURI(gBrowser.currentURI.spec) }); } ); }()); |
|
上一页
下一页