MCPcopy
hub / github.com/darkreader/darkreader / startActivation

Method startActivation

src/background/extension.ts:649–663  ·  view source on GitHub ↗
(email: string, key: string)

Source from the content-addressed store, hash-verified

647 }
648
649 private static async startActivation(email: string, key: string) {
650 const delay = 2000 + Math.round(Math.random() * 2000);
651 const checkEmail = (email: string) => email && email.trim().includes('@');
652 const checkKey = (key: string) => key.replaceAll('-', '').length === 25 && key.toLocaleLowerCase().startsWith('dr') && key.replaceAll('-', '').match(/^[0-9a-z]{25}$/i);
653 setTimeout(async () => {
654 await writeLocalStorage({activationEmail: email, activationKey: key});
655 if (checkEmail(email) && checkKey(key)) {
656 await UIHighlights.hideHighlights(['anniversary']);
657 if (__PLUS__) {
658 await Extension.changeSettings({previewNewestDesign: true});
659 }
660 }
661 Extension.reportChanges();
662 }, delay);
663 }
664
665 private static async resetActivation() {
666 await removeLocalStorage(['activationEmail', 'activationKey']);

Callers

nothing calls this directly

Calls 4

writeLocalStorageFunction · 0.90
hideHighlightsMethod · 0.65
changeSettingsMethod · 0.65
reportChangesMethod · 0.45

Tested by

no test coverage detected