Skip to content

Instantly share code, notes, and snippets.

@PetreVane
Last active October 4, 2024 09:55
Show Gist options
  • Save PetreVane/090e9dd97d7ac2fd39cd3dfd4fb3a002 to your computer and use it in GitHub Desktop.
Save PetreVane/090e9dd97d7ac2fd39cd3dfd4fb3a002 to your computer and use it in GitHub Desktop.
Set LocalStorage
(function() {
function setLicenseKey() {
localStorage.setItem('TM_useLicenseKey', 'your_license_key_here');
console.log('TM_useLicenseKey has been set in local storage');
const newChatButton = document.querySelector('[data-element-id="new-chat-button-in-side-bar"]');
if (newChatButton && newChatButton.childNodes[1]) {
newChatButton.childNodes[1].textContent = 'License Key Set!';
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', setLicenseKey);
} else {
setLicenseKey();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment