Skip to content

Commit

Permalink
v0.8.6; fix options; closes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
sereneblue committed Aug 17, 2018
1 parent 4543c00 commit fd0281f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Chameleon

![Chameleon version](https://img.shields.io/badge/version-0.8.5-brightgreen.svg)
![Chameleon version](https://img.shields.io/badge/version-0.8.6-brightgreen.svg)
![GPL v3 License](https://img.shields.io/badge/license-GPL%20v3-blue.svg)

Chameleon is a WebExtension port of the popular Firefox addon [Random Agent Spoofer](https://github.com/dillbyrne/random-agent-spoofer).
Expand Down
12 changes: 10 additions & 2 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,15 @@ function migrate(data) {
*/

chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if (request.action == "exclude") {
if (request.action == "clear") {
if (request.data == "resetTracking") {
chrome.privacy.websites.trackingProtectionMode.clear({});
} else if (request.data == "resetFirstParty") {
chrome.privacy.websites.firstPartyIsolate.clear({});
} else if (request.data == "resetFingerprinting") {
chrome.privacy.websites.resistFingerprinting.clear({});
}
} if (request.action == "exclude") {
let key = request.data.key.split('_')[1].match(/([a-z]+)(\d+)/);
let index = parseInt(key[2]);
chameleon.excluded[key[1]][index - 1] = request.data.value;
Expand Down Expand Up @@ -705,6 +713,6 @@ chrome.alarms.onAlarm.addListener(function(alarm) {
});
}

await save({ version: "0.8.5"});
await save({ version: "0.8.6"});
changeTimer();
})();
15 changes: 15 additions & 0 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,21 @@ document.addEventListener('DOMContentLoaded', function() {
});
});

$('#list_standard button').on('click', function(e) {
if (e.target.name == "resetTracking") {
$('input[name="enableTrackingProtection"]').prop('checked', false);
} if (e.target.name == "resetFirstParty") {
$('input[name="firstPartyIsolate"]').prop('checked', false);
} if (e.target.name == "resetFingerprinting") {
$('input[name="resistFingerprinting"]').prop('checked', false);
}

chrome.runtime.sendMessage({
action: "clear",
data: e.target.name
});
})

$('#options select').on('change', function(e) {
chrome.runtime.sendMessage({
action: "option",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}
},
"name": "Chameleon",
"version": "0.8.5",
"version": "0.8.6",
"manifest_version": 2,
"description": "Spoof your browser profile. Includes a few privacy enhancing options.",
"background": {
Expand Down
8 changes: 4 additions & 4 deletions src/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="tab" id="about">
<img src="img/icon_48.png">
<h2 class="centered">Chameleon</h2>
<h4 class="centered">v0.8.5</h4>
<h4 class="centered">v0.8.6</h4>
<br/>
<p class="centered">
Developed by <a href="https://github.com/sereneblue">sereneblue</a> and <a href="https://github.com/sereneblue/chameleon/graphs/contributors">contributors</a>
Expand Down Expand Up @@ -267,13 +267,13 @@ <h4 class="centered">v0.8.5</h4>
<div class="list" id="list_standard">
<div class="opt">
<div class="opt">
<label><input name="enableTrackingProtection" type="checkbox"> Enable tracking protection</label>
<label><input name="enableTrackingProtection" type="checkbox"> Enable tracking protection</label><button style="margin-left: 1em" name="resetTracking">reset</button>
</div>
<div class="opt">
<label><input name="firstPartyIsolate" type="checkbox"> Enable 1st party isolation</label>
<label><input name="firstPartyIsolate" type="checkbox"> Enable 1st party isolation</label><button style="margin-left: 1em" name="resetFirstParty">reset</button>
</div>
<div class="opt">
<label><input name="resistFingerprinting" type="checkbox"> Resist fingerprinting</label>
<label><input name="resistFingerprinting" type="checkbox"> Resist fingerprinting</label><button style="margin-left: 1em" name="resetFingerprinting">reset</button>
</div>
</div>
</div>
Expand Down

0 comments on commit fd0281f

Please sign in to comment.