()
| 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) { |
no test coverage detected