Last active
June 1, 2023 16:12
-
-
Save rajtilakjee/a61908fde4e2b3505f1f294137d0b1e9 to your computer and use it in GitHub Desktop.
Chrome extension to replace paywall
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
// Get the current page URL | |
var currentURL = window.location.href; | |
// Replace the protocol with 'https://12ft.io/' | |
var modifiedURL = currentURL.replace(/^https?:\/\//i, 'https://12ft.io/'); | |
// Create a new <a> element | |
var link = document.createElement('a'); | |
// Set the href attribute of the <a> element to the modified URL | |
link.href = modifiedURL; | |
// Simulate clicking on the link to navigate to the modified URL | |
link.click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment