Das GreaseMonkey-Skript
Alternativ für das Kontextmenü:
JavaScript
//ScrollTopAndBottom.uc.js
(function() {
let menuitem = document.createXULElement('menuitem');
menuitem.id = 'context-to-top';
menuitem.classList.add('menuitem-iconic');
menuitem.setAttribute('tooltiptext' , '');
menuitem.style.listStyleImage='url("chrome://browser/skin/downloads/downloads.svg")';
menuitem.setAttribute('oncommand' , "ownerGlobal.gBrowser.selectedBrowser.messageManager.loadFrameScript(' data: , content.scrollTo({ top: 0, left: 0, behavior: \"smooth\" })' , false);");
let refItem = document.getElementById('context-reload');
refItem.parentNode.insertBefore(menuitem, refItem);
})();
(function() {
let menuitem = document.createXULElement('menuitem');
menuitem.id = 'context-to-bottom';
menuitem.classList.add('menuitem-iconic');
menuitem.setAttribute('tooltiptext' , '');
menuitem.style.listStyleImage='url("chrome://browser/skin/downloads/downloads.svg")';
menuitem.setAttribute('oncommand' , "ownerGlobal.gBrowser.selectedBrowser.messageManager.loadFrameScript(' data: , content.scrollTo({ top:100000, left: 0, behavior: \"smooth\" })' , false);");
let refItem = document.getElementById('context-reload');
refItem.parentNode.insertBefore(menuitem, refItem);
var css = '\
#context-to-top { \
list-style-image: url("chrome://browser/skin/downloads/downloads.svg");\
transform:rotate(180deg)!important;\
margin-left: 0px !important;\
margin-right: 15px !important;\
}\
}';
var cssUri = Services.io.newURI('data:text/css,' + encodeURIComponent(css), null, null);
var SSS = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
SSS.loadAndRegisterSheet(cssUri, SSS.AGENT_SHEET);
})();
Alles anzeigen