mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1264623 - Allow for a leading slash in the path to web_accessible_resources, r=kmag
MozReview-Commit-ID: IWbzhs9dpX2 --HG-- extra : transplant_source : j%F5%0E%AAW%F87ijJ%14%26%08%F9%03%96%5Dw%EC%23
This commit is contained in:
parent
633e8d6be7
commit
171756faf0
@ -1164,7 +1164,13 @@ Extension.prototype = extend(Object.create(ExtensionData.prototype), {
|
||||
}
|
||||
this.whiteListedHosts = new MatchPattern(whitelist);
|
||||
|
||||
this.webAccessibleResources = new MatchGlobs(manifest.web_accessible_resources || []);
|
||||
// Strip leading slashes from web_accessible_resources.
|
||||
let strippedWebAccessibleResources = [];
|
||||
if (manifest.web_accessible_resources) {
|
||||
strippedWebAccessibleResources = manifest.web_accessible_resources.map(path => path.replace(/^\/+/, ""));
|
||||
}
|
||||
|
||||
this.webAccessibleResources = new MatchGlobs(strippedWebAccessibleResources);
|
||||
|
||||
for (let directive in manifest) {
|
||||
if (manifest[directive] !== null) {
|
||||
|
@ -96,7 +96,7 @@ add_task(function* test_web_accessible_resources() {
|
||||
],
|
||||
|
||||
"web_accessible_resources": [
|
||||
"accessible.html",
|
||||
"/accessible.html",
|
||||
"wild*.html",
|
||||
],
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user