Skip to content

Commit a5855ba

Browse files
committed
new: few more options for the captures
1 parent e2e77c2 commit a5855ba

8 files changed

+36
-12
lines changed

background_script.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Put all the javascript code here, that you want to execute in background.
22

3+
"use strict";
4+
35
function handleClick() {
46
browser.runtime.openOptionsPage();
57
}

browserAction/index.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@
2323
</div>
2424
<div class="cookie-box">
2525
<input type="checkbox" id="cookies">
26-
<label for="cookies">Pass all the cookies to the capture</label>
26+
<label for="cookies">[Dangerous] Pass all the cookies of the browser to the capture</label>
27+
</div>
28+
<div>
29+
<input type="checkbox" id="locale">
30+
<label for="locale">Pass the locale of the browser</label>
31+
<div style="font-size:12px" class="current-locale"></div>
32+
</div>
33+
<div class="tracking-box">
34+
<input type="checkbox" id="allow_tracking">
35+
<label for="allow_tracking">Attempt to allow all tracking during the capture</label>
2736
</div>
2837
<button id="capture">Launch Capture on Lookyloo</button>
2938
<div style="font-size:15px; color:red;" class="error-submit"></div>

browserAction/script.js

+11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
"use strict";
2+
13
async function onGot(tabs){
24
const tab = tabs[0];
35
let pass_referrer = document.querySelector('.capture #referrer:checked') !== null;
6+
let pass_locale = document.querySelector('.capture #locale:checked') !== null;
47
let pass_cookies = document.querySelector('.capture #cookies:checked') !== null;
58
let pass_ua = document.querySelector('.capture #useragent:checked') !== null;
9+
let allow_tracking = document.querySelector('.capture #allow_tracking:checked') !== null;
610

711

812
const config = await browser.storage.local.get().then(res => res);
@@ -31,6 +35,12 @@ async function onGot(tabs){
3135
if (pass_ua === true) {
3236
data.user_agent = navigator.userAgent;
3337
}
38+
if (pass_locale === true) {
39+
data.locale = browser.i18n.getUILanguage();
40+
}
41+
if (allow_tracking === true) {
42+
data.allow_tracking = true;
43+
}
3444

3545
console.log(`${config.url}/submit`);
3646
await fetch(`${config.url}/submit`, {
@@ -81,6 +91,7 @@ document.addEventListener('DOMContentLoaded', (e) => {
8191
document.querySelector(".stored-url").textContent = `Current instance: ${res.url}`
8292
});
8393
document.querySelector(".current-ua").textContent = `Current User-Agent: ${navigator.userAgent}`
94+
document.querySelector(".current-locale").textContent = `Current Locale: ${browser.i18n.getUILanguage()}`
8495
browser.storage.local.get().then(res => {
8596
if (!res.private) {
8697
document.querySelector(".cookie-box").hidden = true;

manifest.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
"default_icon": {
1010
"64": "icons/icon.png"
1111
},
12-
"default_title": "lookyloo",
12+
"default_title": "Lookyloo",
1313
"default_popup": "browserAction/index.html"
1414
},
1515
"browser_specific_settings": {
1616
"gecko": {
17-
17+
1818
"strict_min_version": "127.0"
1919
},
2020
"gecko_android": {
21-
21+
2222
"strict_min_version": "127.0"
2323
},
2424
"safari": {
25-
25+
2626
"strict_min_version": "15"
2727
}
2828
},
@@ -39,8 +39,7 @@
3939
"manifest_version": 3,
4040
"name": "lookyloo",
4141
"options_ui": {
42-
"page": "options/index.html",
43-
"chrome_style": true
42+
"page": "options/index.html"
4443
},
4544
"optional_permissions": [
4645
"cookies"

options/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
You <b>absolutely do not want</b> to do that unless the instance you're using is private as it
1212
will contain login cookies that can be reused by 3rd parties.
1313
</p>
14-
<form class="browser-style">
14+
<form>
1515

1616
<label for="url">URL of the lookyloo instance</label>
1717
<input type="text" id="url" name="url"/>
@@ -24,7 +24,7 @@
2424
</label>
2525
<br>
2626

27-
<button class="browser-style" type="submit">Save</button>
27+
<button type="submit">Save</button>
2828
</form>
2929
<script src="script.js"></script>
3030
</body>

options/script.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
async function saveOptions(e) {
24
let private_ok = false;
35

views/getting_started.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
function uninstall() {
24
var settingUrl = browser.runtime.setUninstallURL("https://lookyloo.circl.lu/capture");
35
settingUrl.then(() => true, (error) => true);

views/installed.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<head>
55
<meta charset="utf-8">
66
<title>Getting started with Lookyloo</title>
7-
<link rel="stylesheet" href="chrome://browser/content/extension.css">
87
<link rel="stylesheet" href="default.css">
98
</head>
109

@@ -32,7 +31,7 @@ <h1>Welcome to Lookyloo!</h1>
3231
<br>
3332
<br>
3433
<div>
35-
<button id="setup" class="browser-style">I know what I'm doing.</button>
34+
<button id="setup">I know what I'm doing.</button>
3635
<div>
3736
</p>
3837

@@ -43,7 +42,7 @@ <h1>Welcome to Lookyloo!</h1>
4342
<br>
4443
<br>
4544
<div>
46-
<button id="uninstall" class="browser-style">Uninstall Lookyloo</button>
45+
<button id="uninstall">Uninstall Lookyloo</button>
4746
</div>
4847
It will redirect you to the <a href="https://lookyloo.circl.lu">demo instance</a>,
4948
where you can safely capture an URL without risking to leak personal information.

0 commit comments

Comments
 (0)