Created
March 11, 2023 01:35
-
-
Save dhaigh/de36a208bc5bd7067e1b2c8211e19cec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name lit.dev script | |
// @version 0.1 | |
// @description Redirect lit.dev pages to new docs | |
// @match *://*.lit.dev/* | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
console.log('lit.dev script running, redirecting from old docs...'); | |
const banner = document.getElementsByTagName('litdev-banner')[0]; | |
if (banner?.textContent.includes('older version')) { | |
const link = banner.getElementsByTagName('a')[0]; | |
window.location.href = link.href; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment