今天更新了Firefox 57,
第一件事發現的是userChromeJs不相容了.
只好上網找找看有沒有人已經解決了. 幸好已經有解了.
Firefox 57+ 使用 UC 脚本 https://www.bilimoe.com/uc-script/
or
Endor8/userChrome.js · GitHub https://github.com/Endor8/userChrome.js/tree/master/userChrome
雖然userChromeJS可以work了.
但還是有一堆uc.js是不相容. 只好一個一個自己試著改了.
先記錄這個我改好而且是最常用的copy link的 uc.js
(function() {
var mpopup = document.getElementById("userChrome-MenuPopup");
if (!mpopup) {
mpopup = document.createElement("menupopup");
mpopup.setAttribute("id", "userChrome-MenuPopup");
m.appendChild(mpopup);
}
var mitem = document.createElement("menuitem");
mitem.setAttribute("label", "Copy URL+Title");
mitem.setAttribute("oncommand", "var wm = Components.classes[\"@mozilla.org/appshell/window-mediator;1\"].getService(Components.interfaces.nsIWindowMediator); var win = wm.getMostRecentWindow(\"navigator:browser\");Components.classes[\"@mozilla.org/widget/clipboardhelper;1\"].getService(Components.interfaces.nsIClipboardHelper).copyString( win.gBrowser.contentTitle +\" \"+ win.gBrowser.currentURI.spec);");
mpopup.appendChild(mitem);
})();
另外一個就是告訴firefox不要用startupcache,
如果沒有這個uc.js,每次更改uc.js檔案的時候,
就得乖乖手動去刪掉
%USERPROFILE%\AppData\Local\Mozilla\Firefox\Profiles\[profile name]\startupCache
目錄下的檔案.
這樣你所做的修改才會發生效用,
要不然firefox可能會笨笨的還在用舊版uc.js檔.
有這個uc.js再搭配restart firefox就可以很順暢地修改uc.js檔案了.
(function()
{
var mpopup = document.getElementById("userChrome-MenuPopup");
if (!mpopup) {
mpopup = document.createElement("menupopup");
mpopup.setAttribute("id", "userChrome-MenuPopup");
m.appendChild(mpopup);
}
var mitem;
mitem = document.createElement("menuitem");
mitem.setAttribute("label", "Startupcache Invalidate");
mitem.setAttribute("oncommand", "Services.obs.notifyObservers(null, \"startupcache-invalidate\", \"\");");
mpopup.appendChild(mitem);
})();
剩下就再慢慢一個個改成可以相容Firefox 57+...
真是麻煩~~~
update 2019/4/14:
如果是用舊版的endor8版本,
需要在config-prefs.js多加下面這個設定.
pref("general.config.sandbox_enabled", false);