Page 2 of 2
Re: invoking bookmarklet with keyword is prevented
Posted: Sun Feb 26, 2012 3:04 am
by Guest
You're right, it does work - I changed all the noscript settings back to default, which fixed it. I had noscript.global=true for some reason (I'm not even sure what that does). But after I changed it to the default false, the bookmarklets worked. Thanks

I should have thought of changing everything to defaults earlier.
Re: invoking bookmarklet with keyword is prevented
Posted: Tue Feb 28, 2012 12:29 am
by GµårÐïåñ
Even without changing anything and using a
profile that has been continually updated without a reset for months, it worked fine for me.
Re: invoking bookmarklet with keyword is prevented
Posted: Mon Aug 05, 2013 1:42 pm
by Guest
I have the same issue after installing Custom Button with this code (it opens all the links in new tabs):
Code: Select all
// Bookmarks/History/Homepage/URL/Search open all in new tab ......................................
eval("whereToOpenLink = " + whereToOpenLink.toString()
.replace(/return "current";/g, "{"+(function() {
var node = e && e.originalTarget;
while (node) {
switch (node.id) {
case "bookmarksMenuPopup":
case "goPopup":
case "appmenu_bookmarksPopup":
case "appmenu_historyMenupopup":
case "personal-bookmarks":
case "bookmarks-menu-button":
case "historymenu_history":
case "home-button":
case "page-proxy-stack":
case "go-button":
case "urlbar-go-button":
case "PopupAutoCompleteRichResult":
case "searchbar":
case "PopupAutoComplete":
return "tab";
}
node = node.parentNode;
}
return "current";
}).toString().replace(/^.*{|}$/g, "")+"}")
);
//Bookmarklet
eval("openLinkIn = " + openLinkIn.toString()
.replace(/(?=if \(where == "save"\))/, 'if (url.substr(0, 11) == "javascript:") where = "current";')
.replace(/(?=var loadInBackground)/, 'if (w.gBrowser.currentURI.spec == "about:blank" && !w.gBrowser.mCurrentTab.hasAttribute("busy")) where = "current";')
);
document.getElementById("sidebar-box").addEventListener("load", function(event) {
var document = event.target;
if (document.location == "chrome://browser/content/bookmarks/bookmarksPanel.xul"
|| document.location == "chrome://browser/content/history/history-panel.xul") {
eval("document.defaultView.whereToOpenLink = " + document.defaultView.whereToOpenLink.toString()
.replace(/return "current";/g, 'return "tab";')
);
eval("document.defaultView.openLinkIn = " + document.defaultView.openLinkIn.toString()
.replace(/(?=if \(where == "save"\))/, 'if (url.substr(0, 11) == "javascript:") where = "current";')
.replace(/(?=var loadInBackground)/, 'if (w.gBrowser.currentURI.spec == "about:blank" && !w.gBrowser.mCurrentTab.hasAttribute("busy")) where = "current";')
);
}
}, true);
//
eval("gURLBar.handleCommand = " + gURLBar.handleCommand.toString()
.replace(/aTriggeringEvent\s*&&\s*aTriggeringEvent.altKey/, "!($&)")
.replace("aTriggeringEvent.preventDefault();", "")
.replace("aTriggeringEvent.stopPropagation();", "")
);
And it seems this script and NS are conflicting.
My bookmarklets work while being invoked with click but with keyword they don't.
It only occurres on the sites that are not whitelisted.
Is there any solution?
May be any settings of the NS should be changed?
These parameters are set as follows:
user_pref("noscript.allowBookmarkletImports", true);
user_pref("noscript.allowURLBarImports",true);
user_pref("noscript.allowURLBarJS", true);
user_pref("noscript.forbidBookmarklets",false);
Or may be it is possible to make some changes to above javascript?
Re: invoking bookmarklet with keyword is prevented
Posted: Tue Aug 06, 2013 7:20 pm
by Guest
Guest wrote:I have the same issue after installing Custom Button with this code (it opens all the links in new tabs): ......................................
......................................
Is there any solution?
May be any settings of the NS should be changed?
Or may be it is possible to make some changes to above javascript?
Help me please!!
Re: invoking bookmarklet with keyword is prevented
Posted: Tue Aug 06, 2013 7:50 pm
by GµårÐïåñ
Giorgio is currently unavailable. When he gets back, I will have him take a look.
Re: invoking bookmarklet with keyword is prevented
Posted: Tue Aug 06, 2013 10:31 pm
by Giorgio Maone
The code above replaces browser code, which has already been patched by NoScript in order to allow bookmarklets to work, throwing away NoScript's patches.
Therefore yes, it conflicts with NoScript breaking its ability to emulate bookmarklets.
If the code is yours, please try to debug it especially checking how it changes the gURLBar.handleCommand function.
Re: invoking bookmarklet with keyword is prevented
Posted: Wed Aug 07, 2013 2:57 pm
by Guest
Giorgio Maone wrote:...If the code is yours, please try to debug it especially checking how it changes the gURLBar.handleCommand function.
The code isn't mine and unfortunately I'm not good at this stuff so I can't debug or something...
Anyway thank you for your reply.