Permalink
Browse files

Merge pull request #38 from TheoBr/default_all_bing

Default redirect all bing searches ("provide functionality upon installation" for Google)
  • Loading branch information...
TheoBr committed Sep 14, 2017
2 parents 8cbf868 + 2e7fc84 commit 82f99dd89c6e2f0a6ccbb99e34e52782bc58b360
Showing with 21 additions and 8 deletions.
  1. +1 −2 Chrometana/js/bootstrap.js
  2. +18 −4 Chrometana/js/options.js
  3. +1 −1 Chrometana/manifest.json
  4. +1 −1 package.json
@@ -105,8 +105,7 @@
if(details.reason === "install"){
chrome.tabs.create({url: "html/options.html?newinstall=yes"});
}else if(details.reason === "update"){
var thisVersion = chrome.runtime.getManifest().version;
console.log("Updated from " + details.previousVersion + " to " + thisVersion + "!");
chrome.tabs.create({url: "html/options.html?update=yes"});
}
});
// Fallback when Chrome is not already running
View
@@ -9,10 +9,24 @@
if (getURLVariable("newinstall") === "yes"){
var installadvice = document.getElementById('installadvice');
addClass(installadvice, 'visible');
// Set all bing searches to redirect by default (Google policy "works by default" workaround)
save_options('all_bing_searches', true);
}
if (getURLVariable("update") === "yes"){
chrome.storage.sync.get(['all_bing_searches'], function (all_bing_searches){
console.log(all_bing_searches);
if(all_bing_searches.all_bing_searches !== null) {
console.log("already set");
} else {
// Set all bing searches to redirect by default (Google policy "works by default" workaround)
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() {
@@ -42,10 +56,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"){
@@ -68,7 +82,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);
View
@@ -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": [
View
@@ -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"
},

0 comments on commit 82f99dd

Please sign in to comment.