Skip to content

Commit

Permalink
Restrict content_script with include_globs. Fixes #130
Browse files Browse the repository at this point in the history
  • Loading branch information
mnoorenberghe committed Jan 28, 2018
1 parent dc3d3e8 commit 4dc2063
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ If you have an idea for an extra feature, either ask me to implement it or
you can implement it yourself and submit a patch. I'll do a better job in the
future of cleaning up the code and possibly making it API-like.

## Bugzilla Installation URLs

To test patterns/globs against installation URLs you can visit https://www.bugzilla.org/installation-list/ and run:
```js
new Set([...document.querySelectorAll("a[href]")].filter(a => a.textContent.trim() == "Bugzilla").map(a => a.href).filter(url => !url.includes("www.bugzilla.org")).filter(url => !url.match(/(.*bugz.*|.*bugs.*|.*Bugs.*|.*bz.*)/)))
```

# TROUBLESHOOTING

- It conflicts with other Bugzilla extensions and Userscripts.
Expand Down
12 changes: 12 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@
{
"matches": [
"*://*/",
"*://*/*bug*/",
"*://*/*.cgi*"
],
"include_globs": [
"*bugz*",
"*bugs*",
"*Bugs*",
"*bz*"
],
"css": [
"css/bugzillajs.css"
],
Expand All @@ -46,6 +53,11 @@
"64": "icon64.png"
},

"options_ui": {
"page": "options.html",
"browser_style": true
},

"permissions": [
"https://api.github.com/*",
"storage"
Expand Down

0 comments on commit 4dc2063

Please sign in to comment.