Skip to content

Instantly share code, notes, and snippets.

@rajtilakjee
Last active June 1, 2023 16:12
Show Gist options
  • Save rajtilakjee/a61908fde4e2b3505f1f294137d0b1e9 to your computer and use it in GitHub Desktop.
Save rajtilakjee/a61908fde4e2b3505f1f294137d0b1e9 to your computer and use it in GitHub Desktop.
Chrome extension to replace paywall
// 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