userChrome.css
CSS
@import url('css/ffc-styles.css');
#context-openlink,
#context-openlinkprivate,
#context-bookmarklink,
#context-sendlinktodevice,
#context-inspect,
#context-openlinkinusercontext-menu,
#context-viewpartialsource-selection,
#context-sep-sendlinktodevice,
#inspect-separator,
#_lympha-menuitem-_lympha-ctx-btn{
display:none!important;
}
#contentAreaContextMenu > menuseparator:nth-child(93){
display:none!important;
}
#jid1-kdtticj6wxvafa_jetpack-menuitem-_sss{
-moz-box-ordinal-group: 100 !important;
}
#context-sendpagetodevice,
#context-viewbgimage,
#context-selectall,
#context-viewsource,
#context-sep-sendpagetodevice,
#context-sep-viewbgimage,
#contentAreaContextMenu > menuseparator:nth-child(93){
display:none!important;
}
#context-sendimage,
#context-setDesktopBackground,
#inspect-separator{
display:none!important;
}
.tab-line[selected] {
display:none!important;
}
#TabsToolbar > .titlebar-buttonbox-container {
display:none}
#TabsToolbar {
margin-bottom:1px!important;
}
.tabbrowser-tab:not([selected="true"]){
background: #C39D74 !important;
border-radius: 80px !important;
border:0px solid black !important;
}
.tab-background[selected="true"] {
background: #F09800 !important;
border-radius: 80px !important;
border:0px solid black!important;
}
.tabbrowser-tab::after, .tabbrowser-tab::before {
margin-inline-start: 0px!important;
border-left: 0px solid!important;
border-image:none!important;
border-image-slice: 0!important;
width: 0px!important;
box-sizing: border-box;
opacity: 0!important;
}
.tab-line {
display:none!important
}
.tabbrowser-tab{
margin-right:5px!important;
}
menuitem[label="TextNotes"] {
display: none !important;
}
#testing_duckduckgo_com-menuitem-1 {
display: none !important;
}
Alles anzeigen
userChrome.js
TabProtectmod.uc.js
Code
// ==UserScript==
// @name tabProtect_mod2.uc.js
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description tabProtect
// @include main
// @exclude about:*
// @author Alice0775
// @Note ??????????
// @Note ???????private browsing???????tab????????tab??????????????
// @compatibility 60
// @version 2018/09/27 10:30 fix tab detach
// @version 2018/09/26 07:30 support tab detach
// @version 2018/09/25 21:30 working with tab multi selection
// @version 2018/06/21 19:50 workaround regression
// @version 2018/06/21 19:40 fix restore session if *.restore_on_demand is enabled
// @version 2018/06/10 00:00 workaround restore session
// @version 2018/05/23 00:00 Fixed typo(status is undeled when unprotect)
// @version 2018/05/12 15:30 workaround restore session for all window
// @version 2018/05/06 14:00 workaround for tab move
// @version 2018/05/04 12:00 cleanup for 60
// @version 2018/05/04 23:00 for 60
// ==/UserScript==
var tabProtect = {
debug: function(aMsg){
Cc["@mozilla.org/consoleservice;1"]
.getService(Ci.nsIConsoleService)
.logStringMessage(aMsg.toString());
},
sessionStore: {
get ss() {
try {
return Components.classes["@mozilla.org/browser/sessionstore;1"].
getService(Components.interfaces.nsISessionStore)
} catch(e) {
return;
}
},
getTabValue : function(aTab, aKey) {
if (typeof SessionStore.getCustomTabValue == "function")
return SessionStore.getCustomTabValue(aTab, aKey);
else
return this.ss.getTabValue(aTab, aKey);
},
setTabValue : function(aTab, aKey, aValue) {
if (typeof SessionStore.setCustomTabValue == "function")
return SessionStore.setCustomTabValue(aTab, aKey, aValue);
else
return this.ss.setTabValue(aTab, aKey, aValue);
},
deleteTabValue : function(aTab, aKey) {
if (typeof SessionStore.deleteCustomTabValue == "function")
return SessionStore.deleteCustomTabValue(aTab, aKey);
else
return this.ss.deleteTabValue(aTab, aKey);
}
},
init: function(){
this.tabContextMenu();
//tabbrowser.xml?????
gBrowser.removeTab_org = gBrowser.removeTab;
gBrowser.removeTab = function(aTab, aParams) {
if (aTab.localName != "tab")
aTab = this.selectedTab;
if (aTab.hasAttribute("tabProtect"))
return;
gBrowser.removeTab_org(aTab, aParams);
}
// CSS???
var stack = document.getAnonymousElementByAttribute(
gBrowser.tabContainer.firstChild, "class", "tab-stack");
var style = `
.tab-close-button[hidden='true'] image {
width: 0px;
}
.tab-icon-protect{
margin-top: 0px; /*???*/
margin-left: 0px; /*???*/
list-style-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQUlEQVQ4jWNgGAXDADASUvDvOsN/fPJMlLqAhRhFTJqo/H/XKXQBsoFEuQDDVnIMQPcGXJxYA3C5hiwvUOwCZAAAlRcK7m+YgB4AAAAASUVORK5CYII=');
}
.tab-icon-protect[hidden='true'] {
display: none;
}
`;
var sspi = document.createProcessingInstruction(
'xml-stylesheet',
'type="text/css" href="data:text/css,' + encodeURIComponent(style) + '"'
);
document.insertBefore(sspi, document.documentElement);
sspi.getAttribute = function(name) {
return document.documentElement.getAttribute(name);
};
this.restoreAll(0);
gBrowser.tabContainer.addEventListener('TabMove', this, false);
gBrowser.tabContainer.addEventListener('SSTabRestoring', this, false);
window.addEventListener('unload', this, false)
// detach tab
let func = gBrowser.swapBrowsersAndCloseOther.toString();
if (gBrowser && !/copytabProtect/.test(func)) {
func = func.replace(
'let otherFindBar = aOtherTab._findBar;',
`if (aOtherTab.hasAttribute("tabProtect")) {
aOurTab.ownerGlobal.gBrowser.protectTab(aOurTab, true);
/*copytabProtect*/
}
$&`
);
eval("gBrowser.swapBrowsersAndCloseOther = function " + func.replace(/^function/, ''));
}
},
restoreAll: function(delay = 0) {
var that = this;
setTimeout(init, delay, 0);
function init(i){
if(i < gBrowser.tabs.length){
var aTab = gBrowser.tabs[i];
that.restoreForTab(aTab);
i++;
arguments.callee(i);
}else{
}
}
},
uninit: function(){
window.removeEventListener('unload', this, false)
gBrowser.tabContainer.removeEventListener('SSTabRestoring', this, false);
gBrowser.tabContainer.removeEventListener('TabMove', this, false);
gBrowser.tabContainer.contextMenu.removeEventListener('popupshowing', this, false);
},
handleEvent: function(event) {
switch(event.type) {
case "unload":
this.uninit(event);
break;
case "SSTabRestoring":
this.restore(event);
break;
case "TabMove":
this.TabMove(event);
break;
case "popupshowing":
this.popupshowing(event);
break;
}
},
TabMove: function(aEvent){
var aTab = aEvent.target;
gBrowser.protectTabIcon(aTab);
},
tabContextMenu: function(){
//tab context menu
var tabContext = gBrowser.tabContainer.contextMenu;
var menuitem = this.tabProtectMenu
= tabContext.appendChild(
document.createElement("menuitem"));
menuitem.id = "tabProtect";
menuitem.setAttribute("type", "checkbox");
if (Services.appinfo.version.split(".")[0] >= 63)
menuitem.setAttribute("label", "Protect This Tab(s)");
else
menuitem.setAttribute("label", "Protect This Tab");
menuitem.setAttribute("accesskey", "P");
menuitem.setAttribute("oncommand","tabProtect.toggle(TabContextMenu.contextTab);");
tabContext.addEventListener('popupshowing', this, false);
},
popupshowing: function(event) {
this.setCheckbox(event);
},
restore: function(event){
tabProtect.restoreAll(0);
},
restoreForTab: function(aTab){
var retrievedData = this.sessionStore.getTabValue(aTab, "tabProtect") == "true";
if(retrievedData){
aTab.setAttribute('tabProtect',true);
var closeButton = document.getAnonymousElementByAttribute(
aTab, "anonid", "close-button");
closeButton.setAttribute('hidden',true);
}
gBrowser.protectTabIcon(aTab);
},
toggle: function(aTab){
if (typeof gBrowser.selectedTabs != "undefined") {
this.toggleProtectSelectedTabs(this.getSelectedTabs(aTab));
} else {
gBrowser.protectTab(aTab);
}
},
toggleProtectSelectedTabs: function(tabs){
if (tabs.length < 1)
return;
let isProtect = gBrowser.isProtectTab(tabs[0]);
for (let tab of tabs) {
gBrowser.protectTab(tab, !isProtect);
}
},
getSelectedTabs: function(aTab){
let contextTab = aTab;
let selectedTabs = [contextTab];
if (gBrowser.selectedTabs.indexOf(contextTab) < 0)
return selectedTabs;
for (let tab of gBrowser.selectedTabs) {
if (contextTab != tab)
selectedTabs.push(tab);
}
return selectedTabs;
},
setCheckbox: function(event){
var menuitem = this.tabProtectMenu;
var aTab = TabContextMenu.contextTab;
if( !aTab || aTab.localName !='tab'){
menuitem.setAttribute('hidden',true);
return;
}
menuitem.setAttribute('hidden',false);
if(aTab.hasAttribute('tabProtect') && aTab.getAttribute('tabProtect')){
menuitem.setAttribute('checked', true);
}else{
menuitem.setAttribute('checked', false);
}
}
}
gBrowser.isProtectTab = function (aTab){
return aTab.hasAttribute("tabProtect");
}
gBrowser.protectTab = function (aTab, state) {
let isProtected;
if (typeof state == "undefined") {
if ( aTab.hasAttribute("tabProtect") ){
state = false;
} else {
state = true;
}
}
if (state) {
aTab.setAttribute("tabProtect", "true");
tabProtect.sessionStore.setTabValue(aTab, "tabProtect", "true");
isProtected = true;
} else {
aTab.removeAttribute("tabProtect");
try {
tabProtect.sessionStore.deleteTabValue(aTab, "tabProtect");
} catch(e) {}
isProtected = false;
}
this.protectTabIcon(aTab);
return isProtected;
}
gBrowser.protectTabIcon = function (aTab){
const kXULNS =
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var closeButton = document.getAnonymousElementByAttribute(
aTab, "anonid", "close-button");
var image = document.getAnonymousElementByAttribute(
aTab, "class", "tab-icon-protect");
if ( aTab.hasAttribute("tabProtect") ){
closeButton.setAttribute('hidden',true);
if(!image){
var stack = document.getAnonymousElementByAttribute(
aTab, "class", "tab-stack");
var image = document.createElementNS(kXULNS,'image');
image.setAttribute('class','tab-icon-protect');
image.setAttribute('left',0);
image.setAttribute('top',0);
if(stack) stack.appendChild(image);
}
aTab.setAttribute('class',aTab.getAttribute('class')+' tabProtect');
image.removeAttribute('hidden');
}else{
closeButton.setAttribute('hidden',false);
if(image){
image.setAttribute('hidden', true);
}
aTab.setAttribute('class',aTab.getAttribute('class').replace(/\stabProtect/g,''));
}
}
tabProtect.init();
Alles anzeigen
TableisteUnten.uc.js
Code
(function() {
var tabbar = document.getElementById('TabsToolbar');
if (tabbar && !tabbar.collapsed) {
tabbar.parentNode.parentNode.appendChild(tabbar);
};
})();
LoadingBarGrün.uc.js
CSS
/* LoadingBar.uc.js */
(function(){
//Location Bar Enhancer5.1;Loading Bar0.3.0
var cssStr = (function(){/*
#urlbar {
background-image: -moz-repeating-linear-gradient(top, rgba(255,255,255,0), rgba(255,255,255,0) 12px, rgba(255,255,255,1) 12px, rgba(255,255,255,1) 12px), -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(74,250,30,.7) 100%);
background-size:0 0;
background-repeat:repeat-x, no-repeat;
transition: background-size 350ms ease 0s !important;
}
#urlbar:not([style="background-size: 0% 100%;"]) {
animation: progress-bar-stripes 2s linear infinite;
}
@-moz-keyframes progress-bar-stripes {
from {
background-position: 0, 0;
}
to {
background-position: 51px 0, 0;
}
}
*/}).toString().replace(/^.+\s|.+$/,"");
var style = document.createProcessingInstruction("xml-stylesheet", "type=\"text/css\"" + " href=\"data:text/css;base64," + btoa(cssStr) + "\"");
var mainW = document.getElementById("main-window");
document.insertBefore(style, mainW);
function main(window) {
var {document, gBrowser} = window;
function $(id) { return document.getElementById(id) };
var urlbar = $("urlbar");
let pageProgress = 0;
let async = makeWindowHelpers(window).async;
var LoadingBar = {
listener: {
onChangeTab: function(e) {
urlbar.style.backgroundSize = '0% 100%';
pageProgress = 0;
},
onProgressChange: function(aBrowser,webProgress,request,curSelfProgress,maxSelfProgress,curTotalProgress,maxTotalProgress) {
if (gBrowser.contentDocument === aBrowser.contentDocument) {
var val = (curTotalProgress-1)/(maxTotalProgress-1);
pageProgress = val;
urlbar.style.backgroundSize = (100*val) + '% 100%';
if (val > 0.9)
async(function() {
if (pageProgress > 0.95)
urlbar.style.backgroundSize = '100% 100%';
}, 1000);
}
},
onStateChange: function() {
if (pageProgress > 0.95){
async(function() {
urlbar.style.backgroundSize = '0% 100%';
pageProgress = 0;
}, 1000);
}else{
urlbar.style.backgroundSize = '0% 100%';
}
}
}
};
gBrowser.tabContainer.addEventListener('TabSelect',LoadingBar.listener.onChangeTab,false);
gBrowser.addTabsProgressListener(LoadingBar.listener);
unload(function() {
gBrowser.tabContainer.removeEventListener('TabSelect',LoadingBar.listener.onChangeTab,false);
gBrowser.removeTabsProgressListener(LoadingBar.listener);
}, window);
}
watchWindows(main, "navigator:browser");
function runOnLoad(window, callback, winType) {
window.addEventListener("load", function() {
window.removeEventListener("load", arguments.callee, false);
if (window.document.documentElement.getAttribute("windowtype") == winType)
callback(window);
}, false);
}
function runOnWindows(callback, winType) {
function watcher(window) {
try {
callback(window);
}
catch(ex) {}
}
let browserWindows = Services.wm.getEnumerator(winType);
while (browserWindows.hasMoreElements()) {
let browserWindow = browserWindows.getNext();
if (browserWindow.document.readyState == "complete")
watcher(browserWindow);
else
runOnLoad(browserWindow, watcher, winType);
}
}
function watchWindows(callback, winType) {
function watcher(window) {
try {
callback(window);
}
catch(ex) {}
}
runOnWindows(callback, winType);
function windowWatcher(subject, topic) {
if (topic == "domwindowopened")
runOnLoad(subject, watcher, winType);
}
Services.ww.registerNotification(windowWatcher);
unload(function() { Services.ww.unregisterNotification(windowWatcher) });
}
function unload(callback, container) {
let unloaders = unload.unloaders;
if (unloaders == null)
unloaders = unload.unloaders = [];
if (callback == null) {
unloaders.slice().forEach(function(unloader) { unloader() });
unloaders.length = 0;
return null;
}
if (container != null) {
container.addEventListener("unload", removeUnloader, false);
let origCallback = callback;
callback = function() {
container.removeEventListener("unload", removeUnloader, false);
origCallback();
}
}
function unloader() {
try {
callback();
}
catch(ex) {}
}
unloaders.push(unloader);
function removeUnloader() {
let index = unloaders.indexOf(unloader);
if (index != -1)
unloaders.splice(index, 1);
}
return removeUnloader;
}
function makeWindowHelpers(window) {
let {clearTimeout, setTimeout} = window;
function async(callback, delay) {
delay = delay || 0;
let timer = setTimeout(function() {
stopTimer();
callback();
}, delay);
function stopTimer() {
if (timer == null)
return;
clearTimeout(timer);
timer = null;
}
}
return {
async: async,
};
}
})();
Alles anzeigen
HideTabbarWithOneTab.uc.js
Code
// HideTabbarWithOneTab.uc.js
// v. 0.2
(function() {
if (!window.gBrowser)
return;
let tabbar = document.getElementById("TabsToolbar");
function showHideTabbar() {
tabbar.collapsed = (gBrowser.visibleTabs.length == 1);
};
setTimeout(function() {
showHideTabbar();
}, 0);
let observer = new MutationObserver(showHideTabbar);
observer.observe(document.getElementById("tabbrowser-tabs"), {childList: true});
})();
Alles anzeigen
ffc-styles.css
CSS
#toolbar-menubar {
-moz-box-ordinal-group: 1 !important;
}
#nav-bar {
-moz-box-ordinal-group: 2 !important;
}
#PersonalToolbar {
-moz-box-ordinal-group: 3 !important;
}
#TabsToolbar {
-moz-box-ordinal-group: 4 !important;
}
Alles anzeigen
ffc-menu-restart.uc.js
Code
(function() {
let menuitem = document.createElement('menuitem');
menuitem.id = 'fp_menu_restart';
menuitem.setAttribute('label' , 'Neustart');
menuitem.setAttribute('oncommand' , "Services.appinfo.invalidateCachesOnRestart() || BrowserUtils.restartApplication();");
let refItem = document.getElementById('menu_FileQuitItem');
refItem.parentNode.insertBefore(menuitem, refItem);
})();
ffc-button-restart.uc.js
Code
(function() {
try {
Components.utils.import("resource:///modules/CustomizableUI.jsm");
CustomizableUI.createWidget({
id: "uc-restart",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Neustart",
tooltiptext: "Neustart",
onClick: function() {
Services.appinfo.invalidateCachesOnRestart() || BrowserUtils.restartApplication();
},
onCreated: function(aNode) {
aNode.style.listStyleImage = 'url("chrome://browser/skin/reload.svg")';
return aNode;
}
});
} catch (e) {
Components.utils.reportError(e);
};
})();
Alles anzeigen
ffc-button-exit.uc.js
Code
(function() {
try {
Components.utils.import("resource:///modules/CustomizableUI.jsm");
CustomizableUI.createWidget({
id: "uc-quit",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Beenden",
tooltiptext: "Beenden",
onClick: function() {
goQuitApplication();
},
onCreated: function(aNode) {
aNode.style.listStyleImage = 'url(chrome://browser/skin/quit.svg)';
return aNode;
}
});
} catch (e) {
Components.utils.reportError(e);
};
})();
Alles anzeigen
ffc-button-customize.uc.js
Code
(function() {
try {
Components.utils.import("resource:///modules/CustomizableUI.jsm");
CustomizableUI.createWidget({
id: "uc-customize",
defaultArea: CustomizableUI.AREA_NAVBAR,
removable: true,
label: "Anpassen",
tooltiptext: "Anpassen",
onClick: function() {
gCustomizeMode.enter();
},
onCreated: function(aNode) {
aNode.style.listStyleImage = 'url(chrome://browser/skin/customize.svg)';
return aNode;
}
});
} catch (e) {
Components.utils.reportError(e);
};
})();
Alles anzeigen
ffc-appMenu-restart.uc.js
Code
(function() {
let menuitem = document.createElement('toolbarbutton');
menuitem.id = 'fp-appMenu-restart-button';
menuitem.classList.add('subviewbutton', 'subviewbutton-iconic');
menuitem.setAttribute('label' , 'Neustart');
menuitem.setAttribute('tooltiptext' , 'Neustart');
menuitem.style.listStyleImage= 'url("chrome://browser/skin/reload.svg")';
menuitem.setAttribute('oncommand' , "Services.appinfo.invalidateCachesOnRestart() || BrowserUtils.restartApplication();");
let refItem = document.getElementById('appMenu-quit-button');
refItem.parentNode.insertBefore(menuitem, refItem);
})();
Alles anzeigen
AddonLeisteUnten.uc.js
Code
(function() {
if (location != 'chrome://browser/content/browser.xul')
return;
var tb = document.createElement('toolbar');
tb.id = 'new-toolbar';
tb.setAttribute('customizable', true);
tb.setAttribute('mode', 'icons');
var vbox = document.createElement('vbox');
document.getElementById('navigator-toolbox').parentNode.insertBefore(
vbox, document.getElementById('browser-bottombox'));
vbox.appendChild(tb);
CustomizableUI.registerArea('new-toolbar', {legacy: true});
CustomizableUI.registerToolbarNode(tb);
})();
Alles anzeigen