Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
Version 0.9.5.1. Fix for #121 and update default firefox whitelist p…
Browse files Browse the repository at this point in the history
…rofile
  • Loading branch information
dillbyrne committed Jan 15, 2015
1 parent 1cbfd1e commit e25993a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
5 changes: 3 additions & 2 deletions data/js/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ self.port.on("inject", function( intParams, strParams, boolParams) {
// firefox should create a head tag if the document does not have one
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head
window.document.head.appendChild( script );

//needed to force script reinjection when navigating with the history buttons
window.onunload = function(){};
});
//needed to force scrit reinjection when navigating with the history buttons
window.onunload = function(){};
6 changes: 5 additions & 1 deletion lib/PrefServ.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ exports.createPrefs = function(){
PrefServ.set("extensions.agentSpoof.siteWhiteList","youtube.com"); // site whitelist for url only lookups
}
if(!(PrefServ.has("extensions.agentSpoof.whiteListUserAgent"))){
PrefServ.set("extensions.agentSpoof.whiteListUserAgent","Mozilla/5.0 (Windows NT 6.2; rv:34.0) Gecko/20100101 Firefox/34.0");
PrefServ.set("extensions.agentSpoof.whiteListUserAgent","Mozilla/5.0 (Windows NT 6.2; rv:35.0) Gecko/20100101 Firefox/35.0");
}
if(!(PrefServ.has("extensions.agentSpoof.whiteListAppCodeName"))){
PrefServ.set("extensions.agentSpoof.whiteListAppCodeName","Mozilla");
Expand Down Expand Up @@ -270,6 +270,9 @@ exports.createPrefs = function(){
PrefServ.set("extensions.agentSpoof.screens",""); //store the current profiles list of possible screen sizes
}

PrefServ.set("network.http.use-cache", false); //disable bfcache so pages are forced to always load the injection script


};

exports.resetPrefs = function(){
Expand Down Expand Up @@ -326,6 +329,7 @@ exports.resetPrefs = function(){
PrefServ.reset("extensions.agentSpoof.pixeldepth");
PrefServ.reset("extensions.agentSpoof.colordepth");
PrefServ.reset("extensions.agentSpoof.screens");
PrefServ.reset("network.http.use-cache"); //restore the bfcache



Expand Down
23 changes: 3 additions & 20 deletions lib/Ras.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,29 +301,12 @@ exports.onUnload = function(reason){
};

//handle upgrades to new versions of the addon
//current upgrade code handles versions up to 0.9.5.0
//from 0.9.5.0 to 0.9.5.1 only
exports.onUpgrade = function(){

//change random to random_time
if(PrefServ.getter("extensions.agentSpoof.timeInterval") === "random")
PrefServ.setter("extensions.agentSpoof.timeInterval","randomTime");

//remove old profile references as the profile list has been fully updated
//and old profile id's will no longer apply
PrefServ.setter("extensions.agentSpoof.excludeList","");

//Remove the now obsolete prefrences
//They will be removed on the next start of Firefox.
//They have been replaced with the exclusionCount JSON preference.

PrefServ.resetter("extensions.agentSpoof.randomDesktopCount");
PrefServ.resetter("extensions.agentSpoof.randomOtherCount");
PrefServ.resetter("extensions.agentSpoof.totalRandomDesktopCount");
PrefServ.resetter("extensions.agentSpoof.totalRandomAllCount");

//upgrade to the latest firefox if the previous default whilelist profile is in use
if(PrefServ.getter("extensions.agentSpoof.whiteListUserAgent") === "Mozilla/5.0 (Windows NT 6.2; rv:33.0) Gecko/20100101 Firefox/33.0")
PrefServ.setter("extensions.agentSpoof.whiteListUserAgent","Mozilla/5.0 (Windows NT 6.2; rv:34.0) Gecko/20100101 Firefox/34.0");
if(PrefServ.getter("extensions.agentSpoof.whiteListUserAgent") === "Mozilla/5.0 (Windows NT 6.2; rv:34.0) Gecko/20100101 Firefox/34.0")
PrefServ.setter("extensions.agentSpoof.whiteListUserAgent","Mozilla/5.0 (Windows NT 6.2; rv:35.0) Gecko/20100101 Firefox/35.0");

};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"permissions": {"private-browsing": true},
"icon":"data/images/icon.png",
"icon64":"data/images/icon64.png",
"version": "0.9.5.0"
"version": "0.9.5.1"
}

0 comments on commit e25993a

Please sign in to comment.