Skip to content

Instantly share code, notes, and snippets.

@andybak
Last active April 23, 2026 11:12
Show Gist options
  • Select an option

  • Save andybak/ac3b3d8bc1faa1422b4260218a23d444 to your computer and use it in GitHub Desktop.

Select an option

Save andybak/ac3b3d8bc1faa1422b4260218a23d444 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Gitbook
// @match https://docs.openbrush.app/*
// @description Adds edit link to gitbook pages on https://docs.openbrush.app/
// @version 0.1
// @match https://www.tampermonkey.net/index.php?version=4.13.6136&ext=fire&updated=true
// @icon https://www.google.com/s2/favicons?domain=tampermonkey.net
// @grant none
// ==/UserScript==
(function() {
'use strict';
setTimeout(function () {
let el = document.body.appendChild(document.createElement('a'));
el.id = 'quickgblink';
el.innerText = 'EDIT';
el.href = '#';
el.style.position = 'fixed';
el.style.top = '0';
el.style.zIndex = '1000';
el.style.right = '0';
el.style.width = '4em';
el.style.height = '2em';
el.style.border = '1px solid black';
el.style.padding = '3px';
el.style.textAlign = 'center';
function updateLink() {
var path = document.location.href.replace('https://docs.openbrush.app/', '');
el.href = 'https://app.gitbook.com/o/-Mikdl01-6Jga6QTk0rK/s/-Mikdwm98p33AibfiSqN/' + path;
}
updateLink();
el.onmousemove = updateLink;
}, 1000); // 1 second
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment