MCPcopy Index your code
hub / github.com/zxlie/FeHelper / _toggleCurrentOriginExclusion

Function _toggleCurrentOriginExclusion

apps/json-format/content-script.js:374–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372 };
373
374 let _toggleCurrentOriginExclusion = () => {
375 let origin = _getCurrentOriginPattern();
376 let list = _getExcludedOriginList(formatOptions.JSON_FORMAT_EXCLUDED_ORIGINS);
377 let isExcluded = list.some(_matchesCurrentOriginPattern);
378 if (isExcluded) {
379 list = list.filter(item => !_matchesCurrentOriginPattern(item));
380 } else if (!list.some(item => _normalizeExcludedOriginPattern(item) === origin.toLowerCase())) {
381 list.push(origin);
382 }
383
384 let nextValue = list.join('\n');
385 formatOptions.JSON_FORMAT_EXCLUDED_ORIGINS = nextValue;
386 let params = {};
387 params[STORAGE_KEYS.JSON_FORMAT_EXCLUDED_ORIGINS] = nextValue;
388 _saveJsonFormatOptions(params, () => {
389 window.location.reload();
390 });
391 _setExcludeSiteButtonState(!isExcluded);
392 };
393
394 let _isEditableShortcutTarget = target => {
395 if (!target || target === document || target === window) {

Callers 2

_bindOmniToolbarFunction · 0.85

Calls 6

_getCurrentOriginPatternFunction · 0.85
_getExcludedOriginListFunction · 0.85
_saveJsonFormatOptionsFunction · 0.85

Tested by

no test coverage detected