Use es6 string templating

This commit is contained in:
Alexandre Lachèze 2017-07-10 23:50:59 +02:00
parent 73e8769b1f
commit 969c74b886

View file

@ -6,7 +6,7 @@ const {runInThisContext} = require('vm')
const matchesPattern = function (pattern) {
if (pattern === '<all_urls>') return true
const regexp = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$')
const url = location.protocol + '//' + location.host + location.pathname
const url = `${location.protocol}//${location.host}${location.pathname}`
return url.match(regexp)
}