Skip to content

Commit

Permalink
Set all_bing_searches=true on update
Browse files Browse the repository at this point in the history
  • Loading branch information
t3dotgg committed Sep 14, 2017
1 parent 8cbf868 commit ac6e0cb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions Chrometana/js/bootstrap.js
Expand Up @@ -105,6 +105,7 @@
if(details.reason === "install"){
chrome.tabs.create({url: "html/options.html?newinstall=yes"});
}else if(details.reason === "update"){
chrome.tabs.create({url: "html/options.html?update=yes"});
var thisVersion = chrome.runtime.getManifest().version;
console.log("Updated from " + details.previousVersion + " to " + thisVersion + "!");
}
Expand Down
17 changes: 13 additions & 4 deletions Chrometana/js/options.js
Expand Up @@ -11,8 +11,17 @@
addClass(installadvice, 'visible');
}

if (getURLVariable("update") === "yes"){
// var installadvice = document.getElementById('installadvice');
// addClass(installadvice, 'visible');
chrome.storage.sync.get(['search_engine','custom_engine','enable_open_website','all_bing_searches','exclude_settings_app'], function (obj) {
console.log(obj);
});
save_options("all_bing_searches", true);
}

var optionCaller = function() {
save_options('search_engine', this, this.getAttribute('value'));
save_options('search_engine', this.getAttribute('value'));
};

var handleMouseover = function() {
Expand Down Expand Up @@ -42,10 +51,10 @@
value = false;
}
}
save_options(this.id, this, value);
save_options(this.id, value);
};

function save_options(key, element, value){
function save_options(key, value){
var options = {};
options[key] = value;
if(key === "custom_engine"){
Expand All @@ -68,7 +77,7 @@
search_engine: defaultSE,
custom_engine: '',
enable_open_website: false,
all_bing_searches: false,
all_bing_searches: true,
exclude_settings_app: true
}, function(items) {
updateDisplay(items);
Expand Down
2 changes: 1 addition & 1 deletion Chrometana/manifest.json
Expand Up @@ -4,7 +4,7 @@
"name": "Chrometana - Redirect Bing Somewhere Better",
"short_name": "Chrometana",
"description": "Redirect all Bing (and therefore Cortana) searches to a search engine of your choice!",
"version": "2.0.1",
"version": "2.0.2",

"options_page": "html/options.html",
"permissions": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "Chrometana",
"description": "Redirect Bing Somewhere Better http://Chrometana.Theo.li",
"author": "Theo Browne",
"version": "2.0.1",
"version": "2.0.2",
"devDependencies": {
"jshint": "^2.6.0"
},
Expand Down

0 comments on commit ac6e0cb

Please sign in to comment.