Skip to content

Instantly share code, notes, and snippets.

@oliviernt
Last active October 3, 2023 06:45
Show Gist options
  • Save oliviernt/31e956c611c5a91f5ea3a9c909bd1539 to your computer and use it in GitHub Desktop.
Save oliviernt/31e956c611c5a91f5ea3a9c909bd1539 to your computer and use it in GitHub Desktop.
Bookmarklet to prevent NBA.com redirect to local nba site
// on https://nba.com/standings (or some path below the TLD where you normally don't get redirected)
// execute:
(() => {
const cookie = "gr=franceuw"; // you might need to change the cookie value if in another country
document.cookie = cookie;
const div = document.createElement("div");
div.textContent = `Cookie set: ${cookie}`;
div.style.background = "white";
div.style.border = "1px solid limegreen";
div.style["border-radius"] = ".8rem"
div.style.padding = ".8rem";
div.style.position = "absolute";
div.style.top = 0;
div.style.right = 0;
div.style["z-index"] = 99999;
document.body.firstChild.prepend(div);
setTimeout(() => div.remove(), 3000);
})();
(()=>{const cookie="gr=franceuw";document.cookie=cookie;const div=document.createElement("div");div.textContent=`Cookie set: ${ cookie }`;div.style.background="white";div.style.border="1px solid limegreen";div.style["border-radius"]=".8rem";div.style.padding=".8rem";div.style.position="absolute";div.style.top=0;div.style.right=0;div.style["z-index"]=99999;document.body.firstChild.prepend(div);setTimeout(()=>div.remove(),3000)})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment