Skip to content

Commit

Permalink
Encode the filter string for comparison
Browse files Browse the repository at this point in the history
Now it should also match spaces and similar url-unsafe characters.
  • Loading branch information
Onurtag committed Apr 18, 2023
1 parent 40c4712 commit 7c571c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bg/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ chrome.storage.onChanged.addListener((changes, area) => {

function handleUpdated(tabId, changeInfo, tabInfo) {
//toggle tab if it is detected by the filter
if (tabInfo.url.includes(options.urlContains) === false) {
if (tabInfo.url.includes(encodeURI(options.urlContains)) === false) {
return;
}
// console.log("Matched tab url", tabInfo.url);
Expand Down
3 changes: 2 additions & 1 deletion options.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
</div>
<div class="pure-control-group">
<label for="url-contains">Detect url containing </label>
<input id="url-contains" type="text" title="Any url that contains this string will be automatically detected." />
<input id="url-contains" type="text" title="Any url that contains this string will be automatically detected.
(Some characters are automatically encoded to match the url spec. Like 'Space' -> '%20'.)" />
</div>
<div class="pure-control-group">
<label for="prepend-instead">Use prepend instead of append </label>
Expand Down

0 comments on commit 7c571c4

Please sign in to comment.