-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathoptions.html
220 lines (203 loc) · 8.4 KB
/
options.html
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<!--
Copyright (c) 2018 Andy Bao
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<!--
HTML Settings Page
-->
<html>
<head>
<title>DynamicHistory Settings</title>
<!-- JQuery -->
<script src="jquery-3.3.1.min.js"></script>
<!-- Moment -->
<script src="moment.min.js"></script>
<!-- Shared -->
<script src="shared.js"></script>
<!-- Core Javascript -->
<script src="options.js"></script>
<style>
#body h3 {margin: 0; padding:0;}
#body h2, #body h1 {
font-weight: bold;
border-bottom: 1px solid grey;
}
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
padding-top: 200px;
}
.close {
color: #fff;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
opacity: 0.6;
text-decoration: none;
cursor: pointer;
}
.modal-header {
padding: 2px 16px;
color: white;
}
#clear_modal .modal-header {
background-color: #f44336;
}
#restore_modal .modal-header {
background-color: #4caf50;
}
.modal-body {padding: 2px 16px;}
.modal-footer {
padding: 8px 16px;
border-top: 1px solid grey;
}
.modal-content {
position: relative;
background-color: #fefefe;
margin: auto;
padding: 0;
border: 1px solid #888;
width: 80%;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
-webkit-animation-name: animatetop;
-webkit-animation-duration: 0.4s;
animation-name: animatetop;
animation-duration: 0.4s;
}
@-webkit-keyframes animatetop {
from {top: -300px; opacity: 0}
to {top: 0; opacity: 1}
}
@keyframes animatetop {
from {top: -300px; opacity: 0}
to {top: 0; opacity: 1}
}
</style>
</head>
<body>
<div id="body">
<h1>DynamicHistory Settings</h1>
<p>
by: <a href="http://nulldev.xyz">nulldev</a>
</p>
<p>
<b>Note:</b> Settings are saved automatically.
</p>
<h2>Removal criteria</h2>
<h3>Dangerous domains:</h3>
Always delete history for the following domains:<br />
<textarea id="danger_domains" rows="5" data-placeholder="Example:\n\nbad.example.com\nhorrible.bad.com"></textarea><br /><br />
<h3>Safe domains:</h3>
Never delete history for the following domains:<br />
<textarea id="safe_domains" rows="5" data-placeholder="Example:\n\ncool.example.com\ngod.example.com"></textarea><br /><br />
<h3>Dangerous keywords:</h3>
Delete the history for a page containing any of the following words:<br />
<textarea id="bad_words" rows="5" data-placeholder="Example:\n\nhorrible\ndisgusting\nbad"></textarea><br /><br />
<h2>Matching options (for advanced users)</h2>
<h3>Regex 'Dangerous domains':</h3>
Use regex to match for dangerous domains: <input id="do_regex_danger_domains" type="checkbox" /><br /><br />
<h3>Regex 'Safe domains':</h3>
Use regex to match for safe domains: <input id="do_regex_safe_domains" type="checkbox" /><br /><br />
<h3>Regex 'Dangerous keywords':</h3>
Use regex to match for dangerous keywords: <input id="do_regex_danger_keywords" type="checkbox" /><br /><br />
<h3>Check entire URL:</h3>
Check the entire URL (including protocol, path and query) when comparing domains. More useful if regex is enabled. <input id="do_check_entire_url" type="checkbox" /><br /><br />
<h3>Scan full HTML when matching 'Dangerous keywords':</h3>
Scan all HTML code instead of only scanning only visible text: <input id="scan_all" type="checkbox" /><br /><br />
<h3>Enable continuous matching:</h3>
Constantly monitor the page for any 'dangerous keywords'. May adversely affect browser performance. Enable this if DynamicHistory is not working on some pages. <input id="continuous_matching" type="checkbox" /><br /><br />
<h2>Display options</h2>
<h3>Append prefix:</h3>
Append a prefix to any tab that has it's history removed (buggy on some web pages): <input id="do_prefix" type="checkbox" /><br /><br />
<h3>Outline page:</h3>
Apply a colored outline to the page of any tab that has it's history removed (buggy on some web pages): <input id="do_outline" type="checkbox" /><br /><br />
<h3>Show badge:</h3>
Show a badge beside the DynamicHistory icon when viewing a tab that has it's history removed: <input id="do_badge" type="checkbox" /><br /><br />
<h3>Inject CSS:</h3>
Inject custom CSS into any page that has it's history removed: <input id="inject_css" type="checkbox" /><br /><br />
<h3>Inject JavaScript:</h3>
Inject custom JS into any page that has it's history removed: <input id="inject_js" type="checkbox" /><br /><br />
<h3>Prefix text:</h3>
The prefix to be appended if "Append Prefix" is enabled:<br />
<input id="prefix_text" type="text" /><br /><br />
<h3>Outline color:</h3>
The outline color of the page if "Outline Page" is enabled:<br />
<input id="outline_color" type="color" style="width: 100px"><br /><br />
<h3>Badge text:</h3>
The text of the badge to show if "Show Badge" is enabled:<br />
<input id="badge_text" type="text" /><br /><br />
<h3>Badge color:</h3>
The color of the badge to show if "Show Badge" is enabled:<br />
<input id="badge_color" type="color" style="width: 100px"><br /><br />
<h3>CSS code:</h3>
The CSS to be injected if "Inject CSS" is enabled:<br />
<textarea id="css_code" rows="5" data-placeholder="Example:\n\nbody {\n filter: grayscale(100%);\n}"></textarea><br /><br />
<h3>JavaScript code:</h3>
The JavaScript to be injected if "Inject JavaScript" is enabled:<br />
<textarea id="js_code" rows="5" data-placeholder="Example:\n\nalert("History removed!");"></textarea><br /><br />
<div id="custom_hist_proc">
<h2>Advanced</h2>
<h3>Custom history processor:</h3>
Run a custom JavaScript function to modify history items as they are added to the history database.<br><br><b>Be careful when writing your own history processors</b>, as history processors are run continuously on a history entry until an iteration is reached where the entry is not modified by the history processor. When in doubt, open the console for the background page to monitor your history processor's activities so it doesn't end up in an infinite loop.<br />
<textarea id="history_processor" rows="10" cols="50" data-placeholder="Example:\n\n//Pretend that all the sites we visit are secure\nif(item.url.startsWith("http") && !item.url.startsWith("https"))\n item.url = item.url.replace('http', 'https');\n\n//Remove all FTP sites\nif(item.url.startsWith("ftp")\n item.remove();"></textarea><br /><br />
<h3>History processor templates:</h3>
<div id="hp_templates">
</div>
</div>
<h2>Useful actions</h2>
<button id="clear_btn">Reset All Settings</button>
<button id="backup_btn">Backup Settings</button>
<button id="restore_btn">Restore Settings</button>
<input id="file_input" style="display:none" type="file" id="file-input" />
<br /><br />
<a id="oninstall_link" style="display:none" href="oninstall.html">View Installation Instructions</a>
</div>
<div id="clear_modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Reset all settings?</h2>
</div>
<div class="modal-body">
<p>Are you sure you want to reset all settings to their default values?</p>
<p>This action is irreversible!</p>
</div>
<div class="modal-footer">
<button id="clear_yes_btn">Yes</button>
<button id="clear_no_btn">No</button>
</div>
</div>
</div>
<div id="restore_modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Restore complete!</h2>
</div>
<div class="modal-body">
<p>Your settings have been restored!</p>
</div>
<div class="modal-footer">
<button id="restore_close_btn">Close</button>
</div>
</div>
</div>
</body>
</html>