mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-21 15:57:31 +09:00
fix ws, wss and moz-extension in matchpattern
This commit is contained in:
parent
639d4eb85f
commit
5eb353096b
3 changed files with 33 additions and 2 deletions
|
|
@ -18,7 +18,11 @@ this.EXPORTED_SYMBOLS = ["MatchPattern", "MatchGlobs", "MatchURLFilters"];
|
|||
|
||||
/* globals MatchPattern, MatchGlobs */
|
||||
|
||||
const PERMITTED_SCHEMES = ["http", "https", "file", "ftp", "data"];
|
||||
// Keep explicit scheme support broad enough for WebExtensions, while the
|
||||
// match-pattern wildcard remains restricted to web content schemes below.
|
||||
const PERMITTED_SCHEMES = ["http", "https", "file", "ftp", "data",
|
||||
"ws", "wss", "moz-extension"];
|
||||
const ALL_URLS_SCHEMES = ["http", "https", "file", "ftp", "data", "ws", "wss"];
|
||||
const PERMITTED_SCHEMES_REGEXP = PERMITTED_SCHEMES.join("|");
|
||||
|
||||
// This function converts a glob pattern (containing * and possibly ?
|
||||
|
|
@ -40,7 +44,7 @@ function globToRegexp(pat, allowQuestion) {
|
|||
// https://developer.chrome.com/extensions/match_patterns
|
||||
function SingleMatchPattern(pat) {
|
||||
if (pat == "<all_urls>") {
|
||||
this.schemes = PERMITTED_SCHEMES;
|
||||
this.schemes = ALL_URLS_SCHEMES;
|
||||
this.hostMatch = () => true;
|
||||
this.pathMatch = () => true;
|
||||
} else if (!pat) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue