Bookmarklet for Edge

Run a bookmarklet using Tampermonkey for Android version of Microsoft Edge.

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         Bookmarklet for Edge
// @namespace    https://lit.link/toracatman
// @version      2026-02-17
// @description  Run a bookmarklet using Tampermonkey for Android version of Microsoft Edge.
// @author       トラネコマン
// @match        *://*/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license      MIT
// ==/UserScript==

let bookmarklet = [
()=>{

// Your bookmarklet here...
},

// Add “()=>{ ... },” here to add a bookmarklet, first number is 0
];

let css = `
#bml_btn {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 2147483647;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 48px;
	height: 48px;
	border-radius: 24px;
	background-color: #000;
	cursor: pointer;
	transition: all 0.2s ease 0s;
}
#bml_btn.bml_btn_hidden {
	opacity: 0;
	visibility: hidden;
}
`;

(() => {
    if (window != window.parent) return;

    let style = document.createElement("style");
    style.textContent = css;
    document.body.appendChild(style);

    let bml_btn = document.createElement("div");
    bml_btn.id = "bml_btn";
    // Bookmarklet icon from Game-icons.net: https://game-icons.net
    bml_btn.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 512 512"><path fill="#fff" d="M57.594 43v242.563l80 30.53V292c-22.504-3.217-45.065-8.633-62.53-26.844l13.5-12.937c12.15 12.667 29.032 17.263 48.28 20.374L110.656 55.03C93.3 51.725 75.492 48.1 57.594 43m397.125.03c-65.178 17.392-138.354.102-191.22 70.814v208.812c19.795-29.15 45.443-40.866 70.72-46.53c33.914-7.603 66.18-7.163 91.5-27.626l11.75 14.53c-31.256 25.263-68.25 24.386-99.158 31.314c-29.295 6.566-53.978 17.63-72.25 63.187l188.657-71.967zM128.81 49.28l27.407 228.157l.06.563v216.906l19.94-39.28l20.468 38.155V296.814L168.563 57.5l-39.75-8.22zm60.47 24.25l25.593 217.782a88.6 88.6 0 0 1 12.188 8.063c6.452 5.097 12.412 11.36 17.75 18.97V109.5c-15.496-17.475-34.402-28.327-55.532-35.97zm-168.78.846v239.813l6.125 2.25l110.97 40.78v-19.906l-98.407-36.156V74.376zm452.594.03v226.75l-216.938 79.69l-40.78-14.97v38.28c23.21 8.03 58.078 6.813 86.25-2.53v-17.563l184.03-67.625l6.125-2.25V74.407zm-257.72 239.532v31.813l27.564 10.53c-7.04-20.847-16.565-33.66-27.438-42.25q-.062-.044-.125-.092z"/></svg>';
    document.body.appendChild(bml_btn);
    bml_btn.addEventListener("click", () => {
        if (bookmarklet.length == 1) {
            bookmarklet[0]();
            return;
        }
        let n = prompt("Bookmarklet number", 0);
        if (n == "" || n == null) return;
        bookmarklet[n]();
    });

    let prevY = window.pageYOffset;

    window.addEventListener("scroll", () => {
        let currentY = window.pageYOffset;
        if (currentY < prevY) {
            bml_btn.classList.remove("bml_btn_hidden");
        }
        else {
            if (currentY > 0) {
                bml_btn.classList.add("bml_btn_hidden");
            }
        }
        prevY = currentY;
    });
})();