Hallo,
könnte mir jemand dieses Script wieder zum laufen bingen?
Das Script macht, das man mit rechter Maustaste Videos speichern kann von Youtube.
JavaScript
(function() {
if (location != 'chrome://browser/content/browser.xhtml')
return;
try {
CustomizableUI.createWidget({
id: 'mediasource-enabled-button',
type: 'custom',
defaultArea: CustomizableUI.AREA_NAVBAR,
onBuild: function(aDocument) {
var button = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbarbutton');
var attributes = {
id: 'mediasource-enabled-button',
class: 'toolbarbutton-1 chromeclass-toolbar-additional',
removable: 'true',
label: 'media.mediasource',
tooltiptext: Services.prefs.getBoolPref('media.mediasource.enabled') ?
'LiveStream ist an' : 'Video speichern ist an | 2mal RMT',
oncommand: '(' + onCommand.toString() + ')()'
};
for (var a in attributes) {
button.setAttribute(a, attributes[a]);
};
function onCommand() {
var isEnabled = !Services.prefs.getBoolPref('media.mediasource.enabled');
Services.prefs.setBoolPref('media.mediasource.enabled', isEnabled);
event.target.ownerGlobal.BrowserCommands.reload();
var windows = Services.wm.getEnumerator('navigator:browser');
while (windows.hasMoreElements()) {
let button = windows.getNext().document.getElementById('mediasource-enabled-button');
if (isEnabled)
button.setAttribute('tooltiptext', 'LiveStream ist an')
else
button.setAttribute('tooltiptext', 'Video speichern ist an | 2mal RMT');
};
};
return button;
}
});
} catch(e) { };
var css =
// xxx
'#mediasource-enabled-button[tooltiptext="LiveStream ist an"] {list-style-image: url(file:///C:/Users/xxx/AppData/Roaming/Mozilla/Firefox/Profiles/zvjpsewu.xxx/chrome/icon/ytd_LiveStream.svg)} ' +
'#mediasource-enabled-button[tooltiptext="Video speichern ist an | 2mal RMT"] {list-style-image: url(file:///C:/Users/xxx/AppData/Roaming/Mozilla/Firefox/Profiles/zvjpsewu.xxx/chrome/icon/ytd_SaveVideo.svg)} ';
var stylesheet = document.createProcessingInstruction('xml-stylesheet', 'type="text/css" href="data:text/css;utf-8,' + encodeURIComponent(css) + '"');
document.insertBefore(stylesheet, document.documentElement);
})();
Alles anzeigen