content_scripts[].matches use the URL without hash part
This commit is contained in:
parent
8a62d81fc5
commit
73e8769b1f
1 changed files with 2 additions and 2 deletions
|
@ -5,9 +5,9 @@ const {runInThisContext} = require('vm')
|
|||
// https://developer.chrome.com/extensions/match_patterns
|
||||
const matchesPattern = function (pattern) {
|
||||
if (pattern === '<all_urls>') return true
|
||||
|
||||
const regexp = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$')
|
||||
return location.href.match(regexp)
|
||||
const url = location.protocol + '//' + location.host + location.pathname
|
||||
return url.match(regexp)
|
||||
}
|
||||
|
||||
// Run the code with chrome API integrated.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue