webext-patterns 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +9 -1
- package/package.json +1 -1
- package/readme.md +1 -1
package/index.js
CHANGED
|
@@ -107,5 +107,13 @@ export function excludeDuplicatePatterns(matchPatterns) {
|
|
|
107
107
|
if (matchPatterns.includes('*://*/*')) {
|
|
108
108
|
return ['*://*/*'];
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
// Cover identical patterns
|
|
111
|
+
const uniquePatterns = [...new Set(matchPatterns)];
|
|
112
|
+
return uniquePatterns.filter(possibleSubset =>
|
|
113
|
+
// Keep if there are no matches
|
|
114
|
+
!uniquePatterns.some(possibleSuperset =>
|
|
115
|
+
// Don't compare to self
|
|
116
|
+
possibleSubset !== possibleSuperset
|
|
117
|
+
// Drop if it's a subset
|
|
118
|
+
&& patternToRegex(possibleSuperset).test(possibleSubset)));
|
|
111
119
|
}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -146,7 +146,7 @@ isValidPattern('https://google.*/*');
|
|
|
146
146
|
- [webext-permissions](https://github.com/fregante/webext-permissions) - Get any optional permissions that users have granted you.
|
|
147
147
|
- [webext-options-sync](https://github.com/fregante/webext-options-sync) - Helps you manage and autosave your extension's options.
|
|
148
148
|
- [webext-storage-cache](https://github.com/fregante/webext-storage-cache) - Map-like promised cache storage with expiration.
|
|
149
|
-
- [webext-detect
|
|
149
|
+
- [webext-detect](https://github.com/fregante/webext-detect) - Detects where the current browser extension code is being run.
|
|
150
150
|
- [Awesome-WebExtensions](https://github.com/fregante/Awesome-WebExtensions) - A curated list of awesome resources for WebExtensions development.
|
|
151
151
|
- [More…](https://github.com/fregante/webext-fun)
|
|
152
152
|
|