-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchrome.patch
165 lines (143 loc) · 5.73 KB
/
chrome.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
diff '--exclude=.git' -ur Fraud-Blocker-multi-browser-extension/include/messaging.js Fraud-Blocker-chrome/include/messaging.js
--- Fraud-Blocker-multi-browser-extension/include/messaging.js 2017-12-25 22:40:52.598484194 +0100
+++ Fraud-Blocker-chrome/include/messaging.js 2017-12-25 22:40:51.666441288 +0100
@@ -32,7 +32,7 @@
var ret={}, prec=null, current='', level=2, ns=extractNS(url), check_sublease=false;
//handle the empty case
- if(ns=="" || ns.substring(0,firefoxInternalProtocol.length)==firefoxInternalProtocol )
+ if(ns=="" || ns.substring(0,chromeInternalProtocol.length)==chromeInternalProtocol )
return {ns:"",msg:"white"};
//if visiting an IP instead of a NS, ignore it anyway
if(/^(?!.*\.$)((?!0\d)(1?\d?\d|25[0-5]|2[0-4]\d)(\.|$)){4}$/.test(ns) )
@@ -120,7 +120,7 @@
var performing=false;
function messageHandler( msg, sender, sendResponse ){
// Only accepts messages from Fraud Blocker
- if(sender.extensionId!==chrome.runtime.id)
+ if(sender.id!==chrome.runtime.id)
return false;
if(msg.msg=="check"){
@@ -129,7 +129,7 @@
// the user is asking to ignore the black-listed site through the popup
else if(msg.msg=='ignore'){
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
- if(tabs[0].url.substring(0,firefoxExtensionsProtocol.length)==firefoxExtensionsProtocol)
+ if(tabs[0].url.substring(0,chromeExtensionsProtocol.length)==chromeExtensionsProtocol)
blockedURL = decodeURIComponent(tabs[0].url.split('?')[1])
else
blockedURL = tabs[0].url
diff '--exclude=.git' -ur Fraud-Blocker-multi-browser-extension/include/shared.js Fraud-Blocker-chrome/include/shared.js
--- Fraud-Blocker-multi-browser-extension/include/shared.js 2017-12-25 22:30:28.725673801 +0100
+++ Fraud-Blocker-chrome/include/shared.js 2017-12-25 22:35:41.900179122 +0100
@@ -3,10 +3,10 @@
// Firefox uses "about" as special protocol to interface with settings' pages
// and other internal pages
-const firefoxInternalProtocol = 'about';
+const chromeInternalProtocol = 'chrome';
// Firefox protocol to access pages that belong to web-extensions
-const firefoxExtensionsProtocol = 'moz-extension';
+const chromeExtensionsProtocol = 'chrome-extension';
var api='api/';
diff '--exclude=.git' -ur Fraud-Blocker-multi-browser-extension/manifest.json Fraud-Blocker-chrome/manifest.json
--- Fraud-Blocker-multi-browser-extension/manifest.json 2017-12-25 22:30:28.725673801 +0100
+++ Fraud-Blocker-chrome/manifest.json 2017-12-25 22:35:41.900179122 +0100
@@ -4,20 +4,15 @@
"name": "Fraud Blocker",
"version": "0.6.4",
- "description": "Protects you from Fraudulent Sites blocking the access. If you access a site that users reported, you'll see how many people reported it on the button on toolbar. The plug-in also allows you to give fraud-feedback on the visited sites through the button on toolbar. Official site on https://fraudblocker.publicvm.com -- For issues and concerns, write to [email protected] ",
+ "description": "Protect from Fraudulent Sites blocking the access. Warn on sites reported but not confirmed to be Fraud. You can to report sites too",
+
+ "author": "Tomas Bortoli",
"icons": {
"48": "icons/icon-48.png",
"96": "icons/icon-96.png"
},
- "applications": {
- "gecko": {
- "id": "[email protected]",
- "strict_min_version": "45.0"
- }
- },
-
"permissions": [
"activeTab",
"tabs",
@@ -30,7 +25,8 @@
],
"background": {
- "page": "background-page.html"
+ "page": "background-page.html",
+ "persistent": true
},
"browser_action": {
diff '--exclude=.git' -ur Fraud-Blocker-multi-browser-extension/popup/guiHandler.js Fraud-Blocker-chrome/popup/guiHandler.js
--- Fraud-Blocker-multi-browser-extension/popup/guiHandler.js 2017-12-25 22:30:28.725673801 +0100
+++ Fraud-Blocker-chrome/popup/guiHandler.js 2017-12-25 22:35:41.900179122 +0100
@@ -51,6 +51,9 @@
}
function checkURL(msg){
+ if(msg==null || msg.msg==null)
+ return;
+
var done=false;
if(checkDisplay('white','none'))
diff '--exclude=.git' -ur Fraud-Blocker-multi-browser-extension/popup/popup.css Fraud-Blocker-chrome/popup/popup.css
--- Fraud-Blocker-multi-browser-extension/popup/popup.css 2017-12-25 22:30:28.725673801 +0100
+++ Fraud-Blocker-chrome/popup/popup.css 2017-12-25 22:35:41.900179122 +0100
@@ -8,6 +8,7 @@
user-select: none; /* Non-prefixed version, currently
not supported by any browser */
overflow-y: hidden;
+ overflow-x: hidden;
}
body{
@@ -19,18 +20,22 @@
}
#black{
+ width: 30em;
display: none;
}
#white{
+ width: 30em;
display: none;
}
#grey{
+ width: 30em;
display: none;
}
#default{
+ width: 24em;
visibility: hidden;
}
@@ -96,6 +101,7 @@
}
#thanks{
+ width: 30em;
display: none;
padding-top: 5%;
text-align: center;
@@ -104,12 +110,14 @@
}
#already{
+ width: 30em;
display: none;
text-align: center;
font-size: 1.1em;
}
#offline{
+ width: 30em;
display: none;
font-size: 1.2em;
}
diff '--exclude=.git' -ur Fraud-Blocker-multi-browser-extension/popup/popup.html Fraud-Blocker-chrome/popup/popup.html
--- Fraud-Blocker-multi-browser-extension/popup/popup.html 2017-12-25 22:30:28.725673801 +0100
+++ Fraud-Blocker-chrome/popup/popup.html 2017-12-25 22:35:41.900179122 +0100
@@ -29,7 +29,7 @@
</div>
<div id="white" style="padding-left:10%;padding-right:10%;">
<img src="/icons/smile.png" id="smile" width="100px" height="100px" />
- <div class="msg" style="margin-top:5%;">This site is known to be non Fraudulent</div>
+ <div class="msg" style="padding-top:9%;padding-left:3%;">This site is known to be non Fraudulent</div>
</div>
<div id="default">
<img src="/icons/burglar.png" id="burglar" width="100px" height="100px"/>