Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesigned settings and popup, updated dependencies #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,43 +98,43 @@ function isDangerous(tab, theHtml) {
if (opt.doRegexSafeDomains) {
let result = batchTest(safeDomains, pageDomain);
if (result.result)
return {result: false, reason: "Domain matches safe domain regex: ", target: result.item};
return {result: false, reason: "Domain matches the following safe domain regex: ", target: result.item};
} else {
let result = contains(safeDomains, pageDomain);
if (result.result)
return {result: false, reason: "Domain is safe domain: ", target: result.item};
return {result: false, reason: "Domain is set as a safe domain: ", target: result.item};
}

//Test danger domains
if (opt.doRegexDangerDomains) {
let result = batchTest(dangerDomains, pageDomain);
if (result.result)
return {result: true, reason: "Domain matches dangerous domain regex: ", target: result.item};
return {result: true, reason: "Domain matches the following dangerous domain regex: ", target: result.item};
} else {
let result = contains(dangerDomains, pageDomain);
if (result.result)
return {result: true, reason: "Domain is dangerous domain: ", target: result.item};
return {result: true, reason: "Domain is set as a dangerous domain: ", target: result.item};
}

if(theHtml != null) {
//Test keywords
if(opt.doRegexDangerKeywords) {
let result = batchTest(badWords, theHtml);
if (result.result)
return {result: true, reason: "HTML matches dangerous keyword regex: ", target: result.item};
return {result: true, reason: "HTML matches the following dangerous keyword regex: ", target: result.item};
} else {
let result = stringContainsAnyStringsOfArrayOfStrings(theHtml, badWords);
if(!result.result) {
result = stringContainsAnyStringsOfArrayOfStrings(theHtml, escapedBadWords);
if(result.result)
return {result: true, reason: "Dangerous keyword (escaped) found on page: ", target: result.item};
return {result: true, reason: "The following dangerous keyword (escaped) was found on this page: ", target: result.item};
} else {
return {result: true, reason: "Dangerous keyword found on page: ", target: result.item};
return {result: true, reason: "The following dangerous keyword was found on this page: ", target: result.item};
}
}
}

return {result: false, reason: "Page does not match any dangerous keywords or domains"};
return {result: false, reason: "This page does not match any dangerous keywords or domains."};
}

//Remove the history for a url
Expand Down
Binary file modified icon-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon-256light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon128light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon16light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icon32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon32light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon48light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions jquery-3.3.1.min.js

This file was deleted.

2 changes: 2 additions & 0 deletions jquery-3.5.1.min.js

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"applications": {
"browser_specific_settings": {
"gecko": {
"id": "@dynamichistory"
}
Expand All @@ -15,7 +15,6 @@
"chrome_style": true,
"browser_style": true
},

"permissions": [
"activeTab",
"tabs",
Expand All @@ -33,12 +32,35 @@
"page": "background.html"
},
"browser_action": {
"browser_style": true,
"default_icon": {
"16": "icon16.png",
"32": "icon32.png",
"48": "icon48.png",
"128": "icon128.png"
},
"theme_icons": [
{
"dark": "icon16.png",
"light": "icon16light.png",
"size": 16
},
{
"dark": "icon32.png",
"light": "icon32light.png",
"size": 32
},
{
"dark": "icon48.png",
"light": "icon48light.png",
"size": 48
},
{
"dark": "icon128.png",
"light": "icon128light.png",
"size": 128
}
],
"default_popup": "popup.html"
},
"sandbox": {
Expand Down
3 changes: 2 additions & 1 deletion moment.min.js

Large diffs are not rendered by default.

Loading