Skip to content

Commit

Permalink
Merge pull request #40 from bfred-it/patch-1
Browse files Browse the repository at this point in the history
Limit to GitHub.com
  • Loading branch information
Brent Yates authored Aug 18, 2016
2 parents 402f56f + b4b3c26 commit adc6e98
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
19 changes: 10 additions & 9 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@
},

"permissions" : ["tabs", "storage"],
"optional_permissions" : ["http://*/*", "https://*/*"],

"content_scripts": [
{
"matches": ["https://*/*/pull/*/files",
"https://*/*/commit*",
"https://*/*/pulls*",
"https://*/*/compare*",
"https://*/*/*/pulls*",
"https://*/*/*/pull/*",
"https://*/*/*/pull/*/files",
"https://*/*/*/commit*",
"https://*/*/*/compare*"
"matches": ["https://github.com/*/pull/*/files",
"https://github.com/*/commit*",
"https://github.com/*/pulls*",
"https://github.com/*/compare*",
"https://github.com/*/*/pulls*",
"https://github.com/*/*/pull/*",
"https://github.com/*/*/pull/*/files",
"https://github.com/*/*/commit*",
"https://github.com/*/*/compare*"
],
"js": ["jquery-1.9.1.min.js", "pullrequest.js"],
"css": ["pullrequest.css"]
Expand Down
8 changes: 8 additions & 0 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,17 @@

var $form = $(e.currentTarget);
var url = $form.find('#url').val();
var origin = url.match(/https?:\/\/[^/?#]+/);
var saveCollapsedDiffs = $form.find('#saveCollapsedDiffs').prop('checked');
var tabSwitchingEnabled = $form.find('#tabSwitchingEnabled').prop('checked');

if (origin) {
origin[0] += '/*';
chrome.permissions.request({
origins: origin
});
}

saveOptionsToChromeStorage({
'url': url,
'saveCollapsedDiffs': saveCollapsedDiffs,
Expand Down

0 comments on commit adc6e98

Please sign in to comment.