Gist ac3b3d8bc1faa1422b4260218a23d444
✓ Published0🌍 Public
Aandybak
Last edited Apr 23, 2026
Created on Feb 15, 2022
A userscript injects a persistent "EDIT" link into Gitbook documentation pages. The script uses the Tampermonkey API via a `@match` directive and runs on `docs.openbrush.app`. It appends a fixed-position anchor element to the document body with `appendChild`, styling it through inline CSS properties. The link’s `href` updates on mouseover by replacing the current URL’s path with an equivalent Gitbook editor address, using `document.location.href` and string concatenation. The code relies on `setTimeout` to delay injection by one second, ensuring the page has loaded before modification.
AI-generated description