-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathg_options.html
More file actions
executable file
·115 lines (92 loc) · 3.83 KB
/
g_options.html
File metadata and controls
executable file
·115 lines (92 loc) · 3.83 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script src="browser-polyfill.min.js"></script>
<script src="whitelist.js"></script>
<script src="whitelist_extra.js"></script>
<script src="options.js"></script>
<style>
textarea {
width: 100%;
max-width: 600px;
min-height: 200px;
}
</style>
</head>
<body>
<div>
<input type="checkbox" id="checkbox-workaround" >
Use workaround to kill <code>document.referrer</code> bug.
<br>
Our workaround is:
on cross-domain navigation, cancel request at <code>onBeforeRequest</code>, then make freshnew one, like directly hit (currently only implemented for GET method, other methods remain as is)
</input>
</div>
<br><br>
<div>
<input type="checkbox" id="checkbox-easycpu" >
(Don't check this if you don't enable above workaround)
<br>
Don't handle <code>onBeforeSendHeaders</code> so reduce CPU consumption.
<br>
(give up this addon's in-page requests HTTP Header referer url trimming)
<br>
#ifndef CHROME
(If you have above workaround enabled, and your Firefox 's <code>network.http.referer.trimmingPolicy = 2</code>, no <code>onBeforeSendHeaders</code> handling is 98% the same as do handling)
#else
#endif
</input>
</div>
<hr>
<div>
<input type="checkbox" id="checkbox-enBuildinWhitelist" >Enable built-in allowlist <span style="text-decoration: underline;">(need restart/reenable)</span></input>
<br>
<ul style="list-style-type: none; margin: 0px;"><li>We currently have hard-coded allowlist (user-define allowlist not yet implemented), for the purpose of not breaking some websites. Some companies have many different websites with different domains. Some of their functionality are based on redirecting between their websites. Some of them check referer. </li></ul>
<br>
<details>
<summary>Built-in allowlist (click to expand/collapse):</summary>
<textarea id="textarea_buildinWhitelist" readonly="true"></textarea>
</details>
</div>
<div style="display:none;">
In addition to hard-coded allowlist, user can add allowed domains
<br>
(Experimental feature! The mechanism may be changed in the future)
<br><br>
User Allowlist:
<br>
<textarea id="textarea_userWhitelist"></textarea>
<br>
<button id="btn_save_userWhitelist">Save</button>
<br>
<div>
Write in JSON.
<br>
Example:
<br>
<code>
<pre>
[
".baidu.com",
[ ".google.com", ".youtube.com"],
"twitter.com",
]
</pre>
</code>
<br>
Above example means no handling referer when:
<code>
<ul style="list-style-type: none;">
<li>*.baidu.com ↔ *.baidu.com</li>
<li>*.google.com ↔ *.google.com </li>
<li>*.google.com ↔ *.youtube.com </li>
<li>*.youtube.com ↔ *.youtube.com</li>
<li>twitter.com ↔ twitter.com</li>
</ul>
</code>
</div>
</div>
<br>
</body>
</html>