MCPcopy Index your code
hub / github.com/refined-github/refined-github / initTokenValidation

Function initTokenValidation

source/options/token-validation.tsx:88–107  ·  view source on GitHub ↗
(syncedForm: SyncedForm | undefined)

Source from the content-addressed store, hash-verified

86}
87
88export default async function initTokenValidation(syncedForm: SyncedForm | undefined): Promise<void> {
89 await validateToken();
90
91 // Listen to events
92 const field = $('input[name="personalToken"]');
93 field.addEventListener('input', validateToken);
94 field.addEventListener('focus', () => {
95 field.type = 'text';
96 });
97 field.addEventListener('blur', () => {
98 field.type = 'password';
99 });
100
101 // Update domain-dependent page content when the domain is changed
102 syncedForm?.onChange(async () => {
103 // TODO: Fix upstream bug https://github.com/fregante/webext-options-sync-per-domain/issues/10#issuecomment-3077459946
104 await delay(100);
105 await validateToken();
106 });
107}

Callers 1

generateDomFunction · 0.85

Calls 2

validateTokenFunction · 0.85
delayFunction · 0.85

Tested by

no test coverage detected