Greasy Fork is available in English.

Mycroft Patch for Firefox 78

Modify page function to use supported features only. Tampermonkey or Violentmonkey. v1.0 2020-06-20

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        Mycroft Patch for Firefox 78
// @author      Jefferson "jscher2000" Scher
// @namespace   JeffersonScher
// @version     1.0
// @copyright   Copyright 2020 Jefferson Scher
// @license     BSD-3-Clause
// @description Modify page function to use supported features only. Tampermonkey or Violentmonkey. v1.0 2020-06-20
// @match       https://mycroftproject.com/*
// @match       http://mycroftproject.com/*
// @grant       unsafeWindow
// ==/UserScript==

unsafeWindow.addOpenSearch = function(name,ext,cat,pid,meth) {
  var title = event.target.textContent;
	// Update the page favicon to pass to the browser
	var favicon = document.querySelector('link[rel="icon"]');
	if (favicon){
		if (ext == 'ico') favicon.setAttribute('type', 'image/vnd.microsoft.icon');
		else favicon.setAttribute('type', 'image/' + ext);
		favicon.href = 'https://mycroftproject.com/updateos.php/id0/' + name + '.' + ext;
	} else {
		favicon = document.createElement('link');
		favicon.setAttribute('rel', 'icon');
		if (ext == 'ico') favicon.setAttribute('type', 'image/vnd.microsoft.icon');
		else favicon.setAttribute('type', 'image/' + ext);
		favicon.href = 'https://mycroftproject.com/updateos.php/id0/' + name + '.' + ext;
		document.getElementsByTagName('head')[0].appendChild(oslink);
	}
	// Add a new link tag for the specified search engine
	var oslink = document.querySelector('link[rel="search"][type="application/opensearchdescription+xml"]');
	if (oslink){
		oslink.remove();
	}
	oslink = document.createElement('link');
	oslink.setAttribute('rel', 'search');
	oslink.setAttribute('type', 'application/opensearchdescription+xml');
	oslink.setAttribute('title', title);
	oslink.href = 'https://mycroftproject.com/installos.php/' + pid + '/' + name + '.xml';
	document.getElementsByTagName('head')[0].appendChild(oslink);
	// Enable visibility of instructional message
	var howtomsg = document.getElementById('howtomsg');
	if (!howtomsg){
		howtomsg = document.createElement('div');
    howtomsg.id = 'howtomsg';
		howtomsg.setAttribute('style', 'position:fixed; top:0; left:25%; width: 50%; text-align: center; padding: 0.75em; border: 2px solid #008; border-radius: 4px; color: #000; background-color: #bee;');
		document.body.appendChild(howtomsg);
	}
	howtomsg.innerHTML = 'Now use the Page Actions menu (•••) in the address bar to add the "' + title + '" search engine to Firefox.';
	howtomsg.style.display = 'block';
};