Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix the detection of shot pages (#2780)
Browse files Browse the repository at this point in the history
Previously Screenshots was not disabled on shot pages
Also simplify a regular expression slightly
  • Loading branch information
ianb authored and jaredhirsch committed Apr 28, 2017
1 parent a405bd4 commit 32d45bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addon/webextension/background/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ this.main = (function() {
if (!url.startsWith(backend)) {
return false;
}
let path = url.substr(backend.length).replace(/^\/*/, "").replace(/#.*/, "").replace(/\?.*/, "");
let path = url.substr(backend.length).replace(/^\/*/, "").replace(/[?#].*/, "");
if (path == "shots") {
return true;
}
if (/^[^/]+\/[^/]+$/.test(url)) {
if (/^[^/]+\/[^/]+$/.test(path)) {
// Blocks {:id}/{:domain}, but not /, /privacy, etc
return true;
}
Expand Down

0 comments on commit 32d45bc

Please sign in to comment.