├── .travis.yml ├── Chrometana ├── images │ ├── Arrow.png │ ├── google.png │ ├── yahoo.png │ ├── cortana.png │ ├── logo-128.png │ ├── logo-32.png │ ├── logo-64.png │ ├── GoogleImage.png │ ├── YahooImage.png │ ├── duckDuckGo.png │ ├── text_bubble.png │ ├── full_cortana.png │ ├── DuckDuckGoImage.png │ └── GoogleImage_bg.png ├── js │ ├── redirect.js │ ├── bootstrap.js │ └── options.js ├── manifest.json └── html │ ├── options.html │ └── css │ └── style.css ├── External assets ├── screenshot.png ├── logo-minimal-600.png └── search_eng_images │ ├── Google.svg │ ├── DuckDuckGo_Logo.svg │ └── Yahoo!_logo.svg ├── package.json ├── .gitignore ├── LICENSE ├── README.md └── .jshintrc /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.12" 4 | - "0.11" 5 | - "0.10" -------------------------------------------------------------------------------- /Chrometana/images/Arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/Arrow.png -------------------------------------------------------------------------------- /Chrometana/images/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/google.png -------------------------------------------------------------------------------- /Chrometana/images/yahoo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/yahoo.png -------------------------------------------------------------------------------- /Chrometana/images/cortana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/cortana.png -------------------------------------------------------------------------------- /Chrometana/images/logo-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/logo-128.png -------------------------------------------------------------------------------- /Chrometana/images/logo-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/logo-32.png -------------------------------------------------------------------------------- /Chrometana/images/logo-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/logo-64.png -------------------------------------------------------------------------------- /External assets/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/External assets/screenshot.png -------------------------------------------------------------------------------- /Chrometana/images/GoogleImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/GoogleImage.png -------------------------------------------------------------------------------- /Chrometana/images/YahooImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/YahooImage.png -------------------------------------------------------------------------------- /Chrometana/images/duckDuckGo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/duckDuckGo.png -------------------------------------------------------------------------------- /Chrometana/images/text_bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/text_bubble.png -------------------------------------------------------------------------------- /Chrometana/images/full_cortana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/full_cortana.png -------------------------------------------------------------------------------- /Chrometana/images/DuckDuckGoImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/DuckDuckGoImage.png -------------------------------------------------------------------------------- /Chrometana/images/GoogleImage_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/Chrometana/images/GoogleImage_bg.png -------------------------------------------------------------------------------- /External assets/logo-minimal-600.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kyleladd/Chrometana/master/External assets/logo-minimal-600.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Chrometana", 3 | "description": "Redirect Bing Somewhere Better http://Chrometana.Theo.li", 4 | "author": "Theo Browne", 5 | "version": "2.0.1", 6 | "devDependencies": { 7 | "jshint": "^2.6.0" 8 | }, 9 | "scripts": { 10 | "test": "jshint --exclude ./node_modules ." 11 | } 12 | } -------------------------------------------------------------------------------- /Chrometana/js/redirect.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | "use strict"; 3 | // Fallback when Chrome is not already running 4 | var url = location.href; 5 | chrome.runtime.sendMessage({"action": "convertURL", "url": url}, 6 | function (response) { 7 | if(response !== url){ 8 | location.href = response; 9 | } 10 | } 11 | ); 12 | }()); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Chrometana.zip 2 | # Dependencies 3 | node_modules/ 4 | 5 | # OS X stuff 6 | *.DS_Store 7 | .AppleDouble 8 | .LSOverride 9 | 10 | # Icon must end with two \r 11 | Icon 12 | 13 | 14 | # Thumbnails 15 | ._* 16 | 17 | # Files that might appear in the root of a volume 18 | .DocumentRevisions-V100 19 | .fseventsd 20 | .Spotlight-V100 21 | .TemporaryItems 22 | .Trashes 23 | .VolumeIcon.icns 24 | .com.apple.timemachine.donotpresent 25 | 26 | # Directories potentially created on remote AFP share 27 | .AppleDB 28 | .AppleDesktop 29 | Network Trash Folder 30 | Temporary Items 31 | .apdisk -------------------------------------------------------------------------------- /Chrometana/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | 4 | "name": "Chrometana - Redirect Bing Somewhere Better", 5 | "short_name": "Chrometana", 6 | "description": "Redirect all Bing (and therefore Cortana) searches to a search engine of your choice!", 7 | "version": "2.0.1", 8 | 9 | "options_page": "html/options.html", 10 | "permissions": [ 11 | "*://*.bing.com/", 12 | "webRequest", 13 | "webRequestBlocking", 14 | "storage", 15 | "background" 16 | ], 17 | "background": { 18 | "scripts": ["js/bootstrap.js"] 19 | }, 20 | "content_scripts": [ { 21 | "matches": ["*://*.bing.com/search*"], 22 | "js": ["js/redirect.js"] 23 | }], 24 | "icons": { 25 | "32": "images/logo-32.png", 26 | "64": "images/logo-64.png", 27 | "128": "images/logo-128.png" 28 | }, 29 | "page_action": { 30 | "default_title": "Chrometana" 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Theo Browne 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /External assets/search_eng_images/Google.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 18 | 23 | 28 | 33 | 38 | 43 | 44 | -------------------------------------------------------------------------------- /Chrometana/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | "use strict"; 3 | var custom_engine; 4 | var storageChange; 5 | var enable_open_website; 6 | var all_bing_searches; 7 | var exclude_settings_app; 8 | function convertURL(url){ 9 | var querystringparams = getUrlVars(url); 10 | var source = getKeyValue(querystringparams, "form"); 11 | if(all_bing_searches === false){ 12 | //Cortana is not the source don't redirect 13 | if(source !== "WNSGPH" && source !== "WNSBOX"){ 14 | return url; 15 | } 16 | } 17 | 18 | if(exclude_settings_app === true){ 19 | //settings app source 20 | if(source === "S00028"){ 21 | return url; 22 | } 23 | } 24 | 25 | url = url.replace(/%20/g,"+"); 26 | var uri = /\?q\=([0-9a-zA-Z-._~:\/?#[\]@!$'()*+,;=%]*)($|(\&))/.exec(url)[1]; 27 | if(enable_open_website === true){ 28 | var match = /^((go\+to\+)|(open\+)|())([0-9a-zA-Z-._~:\/?#[\]@!$'()*+,;=%]*\.[a-z]+)/i.exec(uri); 29 | if(match){ 30 | return "http://" + match[5]; 31 | } 32 | } 33 | if(storageChange === "Google.com"){ 34 | return "https://www.google.com/search?q=" + uri; 35 | } 36 | if(storageChange === "DuckDuckGo.com"){ 37 | return "https://www.duckduckgo.com?q=" + uri; 38 | } 39 | if(storageChange === "Yahoo.com"){ 40 | return "https://search.yahoo.com/search?p=" + uri; 41 | } 42 | if(storageChange === "Custom"){ 43 | return custom_engine + uri; 44 | } 45 | return "https://www.google.com/search?q=" + uri; 46 | } 47 | function getUrlVars(url) 48 | { 49 | var vars = [], hash; 50 | var hashes = url.slice(url.indexOf('?') + 1).split('&'); 51 | for(var i = 0; i < hashes.length; i++) 52 | { 53 | hash = hashes[i].split('='); 54 | vars.push(hash[0]); 55 | vars[hash[0]] = hash[1]; 56 | } 57 | return vars; 58 | } 59 | function getKeyValue(dictionary,key){ 60 | if(key in dictionary){ 61 | return dictionary[key]; 62 | } 63 | return ""; 64 | } 65 | 66 | chrome.storage.sync.get(['search_engine','custom_engine','enable_open_website','all_bing_searches','exclude_settings_app'], function (obj) { 67 | storageChange = obj.search_engine; 68 | enable_open_website = obj.enable_open_website; 69 | all_bing_searches = obj.all_bing_searches; 70 | exclude_settings_app = obj.exclude_settings_app; 71 | if(storageChange === "Custom"){ 72 | custom_engine = obj.custom_engine; 73 | } 74 | }); 75 | 76 | chrome.storage.onChanged.addListener(function(changes/*, namespace*/) { 77 | if(typeof changes.search_engine !== "undefined"){ 78 | storageChange = changes.search_engine.newValue; 79 | } 80 | if(storageChange === "Custom"){ 81 | if(typeof changes.custom_engine !== "undefined"){ 82 | custom_engine = changes.custom_engine.newValue; 83 | } 84 | } 85 | if(typeof changes.enable_open_website !== "undefined"){ 86 | enable_open_website = changes.enable_open_website.newValue; 87 | } 88 | if(typeof changes.all_bing_searches !== "undefined"){ 89 | all_bing_searches = changes.all_bing_searches.newValue; 90 | } 91 | if(typeof changes.exclude_settings_app !== "undefined"){ 92 | exclude_settings_app = changes.exclude_settings_app.newValue; 93 | } 94 | }); 95 | 96 | chrome.webRequest.onBeforeRequest.addListener(function(details) { 97 | var newurl = convertURL(details.url); 98 | if(newurl !== details.url){ 99 | return { redirectUrl: newurl}; 100 | } 101 | }, {urls: ["*://*.bing.com/search*"]}, ["blocking"]); 102 | 103 | // Redirect to welcome.html on install 104 | chrome.runtime.onInstalled.addListener(function(details){ 105 | if(details.reason === "install"){ 106 | chrome.tabs.create({url: "html/options.html?newinstall=yes"}); 107 | }else if(details.reason === "update"){ 108 | var thisVersion = chrome.runtime.getManifest().version; 109 | console.log("Updated from " + details.previousVersion + " to " + thisVersion + "!"); 110 | } 111 | }); 112 | // Fallback when Chrome is not already running 113 | chrome.runtime.onMessage.addListener(onMessage); 114 | function onMessage(request, sender, callback) { 115 | if (request.action === "convertURL") { 116 | callback(convertURL(request.url)); 117 | } 118 | return true; 119 | } 120 | }()); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Chrometana 2 | ============== 3 |  4 | 5 | [](https://travis-ci.org/TheoBr/Chrometana) 6 | 7 | [Link to install on Chrome Web Store](https://chrome.google.com/webstore/detail/kaicbfmipfpfpjmlbpejaoaflfdnabnc) 8 | 9 | [Link to the Chrometana blog](http://Chrometana.Theo.li) 10 | 11 | [Link to RCOS, the Rensselaer Center for Open Source](https://rcos.io) 12 | 13 | BROKEN UNTIL FURTHER NOTICE 14 | ------------ 15 | [Recent changes](https://blogs.windows.com/windowsexperience/2016/04/28/delivering-personalized-search-experiences-in-windows-10-through-cortana/) to Windows 10 prevent Cortana from opening any browser other than Edge. Due to such, Chrometana will not be able to work. 16 | 17 | [Blog post here if you would like to read more: http://chrometana.theo.li/2016/04/cortana-browser-choice-revoked-windows/](http://chrometana.theo.li/2016/04/cortana-browser-choice-revoked-windows/) 18 | 19 | INTRODUCTION 20 | ------------ 21 | With the introduction of Windows 10 to the general public, Bing use is growing rampant. Many aren't using Bing by choice, especially Cortana users. Chrometana aims to force all Bing searches made in Chrome to be redirected to a search engine of the user's choice 22 | 23 | VERSION 24 | ------------ 25 | ### v2.0.1 26 | ##### New features 27 | - Logo updated 28 | 29 | ### v2.0.0 beta 2 30 | ##### New features 31 | - Ability to choose between "all searches" and "only Cortana searches" for redirection 32 | - UI overhaul complete 33 | 34 | ##### Bug fixes 35 | - CSS bug causing buttons to disappear fixed by [kyleladd](https://github.com/kyleladd) 36 | 37 | ### v2.0.0 beta 1 38 | ##### New Features 39 | - Added "Go to (website)" functionality, you can now tell Cortana to go to any website you want by [Claire Pitman](https://github.com/ClairePitman) 40 | - UI overhaul by [Maayan Kline](https://github.com/mok8) and [Courtney Tambling](http://courtneytambling.com/) 41 | - Updated Google logo 42 | - Added custom search engines by [kyleladd](https://github.com/kyleladd) 43 | 44 | ##### Development 45 | - TravisCI implemented (obviously by [kyleladd](https://github.com/kyleladd)) 46 | - JSHint added as the preferred linter 47 | 48 | ##### Known Issues 49 | - "Go To (website)" toggle is broken, always on 50 | - Clearing the "Custom Search Engine" field can be annoying at best 51 | 52 | ### v1.1.2 53 | ##### Bug Fixes/Improvements 54 | - The url replacement has been removed and replaced in favor of a redirect fall-back script by [kyleladd](https://github.com/kyleladd). No more tab permissions! 55 | 56 | ### v1.1.1 57 | ##### Bug Fixes/Improvements 58 | - Moved from redirects to URL replacement and reload added by [kyleladd](https://github.com/kyleladd) 59 | - Moved UI assets out of package to lower size. Options.html assets now load off of Chrometana.theo.li 60 | 61 | ### v1.1.0 62 | ##### New Features 63 | - Major UI overhaul 64 | 65 | ### v1.0.2 66 | ##### Bug Fixes/Improvements 67 | - Fix for background running issues 68 | 69 | ### v1.0.1 70 | ##### Bug Fixes/Improvements 71 | - Actually removed welcome.html 72 | 73 | ### v1.0.0 74 | ##### Bug Fixes/Improvements 75 | - Three search engines are supported, those being Google, Yahoo, and DuckDuckGo. 76 | 77 | INSTALLATION 78 | ------------ 79 | 1. Download the code from here 80 | 2. Navigate chrome to `chrome://extensions` 81 | 3. Check the `Developer mode` toggle 82 | 4. Click on `Load Unpacked Extension...` 83 | 5. Select the folder containing the extension 84 | 85 | HOW TO CONTRIBUTE 86 | ------------ 87 | Want to contribute to Chrometana? Awesome! Feel free to make pull requests directly to the dev branch, or contact Theo with any questions at all at 88 | 89 | 1. Install dependencies 90 | ``` 91 | npm install 92 | ``` 93 | 2. Run jshint for linting tests 94 | ``` 95 | node_modules/jshint/bin/jshint --exclude ./node_modules . 96 | ``` 97 | 98 | CREDITS 99 | ------------ 100 | Lead by [Theo Browne](http://www.theo.li) 101 | 102 | Original development team [Theo Browne](http://www.theo.li), [Claire Pitman](https://github.com/ClairePitman), and [Maayan Kline](https://github.com/mok8) 103 | 104 | Current maintainers [Theo Browne](http://www.theo.li), [Courtney Tambling](http://courtneytambling.com/), and [Kyle Ladd](https://github.com/kyleladd) 105 | 106 | Logo designed by Preston Locke 107 | -------------------------------------------------------------------------------- /Chrometana/html/options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Welcome to Chrometana! 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Check out our blog! 16 | 17 | 18 | 19 | 20 | Chrometana 21 | 22 | 23 | 24 | 25 | Pick your preferred search engine from below 26 | 27 | 28 | 29 | New search engine preferences saved 30 | To come back to this page at any time, go to Chrome Settings, open Extensions, and click Options underneath Chrometana 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | Additional Settings 53 | 54 | 55 | 56 | 57 | 58 | Optional Features 59 | 60 | 61 | Enable "Open Website" 62 | 63 | Enable abilty to search "Open example.com" and load example.com 64 | 65 | 66 | 67 | 68 | 69 | 70 | Apply to all Bing Searches 71 | 72 | Redirect all searches sent to bing (including Cortana) 73 | 74 | Apply Only to Cortana Searches 75 | 76 | Only redirect searches that come from Cortana 77 | 78 | 79 | 80 | 81 | Custom Search Engine 82 | 83 | Use a Custom Search Engine 84 | 85 | 86 | 87 | 88 | 89 | Update 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | // JSHint Default Configuration File (as on JSHint website) 3 | // See http://jshint.com/docs/ for more details 4 | 5 | //"maxerr" : 50, // {int} Maximum error before stopping 6 | 7 | // Enforcing 8 | "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) 9 | "camelcase" : false, // true: Identifiers must be in camelCase 10 | "curly" : true, // true: Require {} for every new block or scope 11 | "eqeqeq" : true, // true: Require triple equals (===) for comparison 12 | "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() 13 | "freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. 14 | "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` 15 | "latedef" : false, // true: Require variables/functions to be defined before being used 16 | "newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()` 17 | "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` 18 | "noempty" : true, // true: Prohibit use of empty blocks 19 | "nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. 20 | "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) 21 | "plusplus" : false, // true: Prohibit use of `++` and `--` 22 | "quotmark" : false, // Quotation mark consistency: 23 | // false : do nothing (default) 24 | // true : ensure whatever is used is consistent 25 | // "single" : require single quotes 26 | // "double" : require double quotes 27 | "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) 28 | "unused" : true, // Unused variables: 29 | // true : all variables, last function parameter 30 | // "vars" : all variables only 31 | // "strict" : all variables, all function parameters 32 | "strict" : true, // true: Requires all functions run in ES5 Strict Mode 33 | "maxparams" : false, // {int} Max number of formal params allowed per function 34 | "maxdepth" : false, // {int} Max depth of nested blocks (within functions) 35 | "maxstatements" : false, // {int} Max number statements per function 36 | "maxcomplexity" : false, // {int} Max cyclomatic complexity per function 37 | "maxlen" : false, // {int} Max number of characters per line 38 | "varstmt" : false, // true: Disallow any var statements. Only `let` and `const` are allowed. 39 | 40 | // Relaxing 41 | "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) 42 | "boss" : false, // true: Tolerate assignments where comparisons would be expected 43 | "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. 44 | "eqnull" : false, // true: Tolerate use of `== null` 45 | //"esversion" : 5, // {int} Specify the ECMAScript version to which the code must adhere. 46 | "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) 47 | // (ex: `for each`, multiple try/catch, function expression…) 48 | "evil" : false, // true: Tolerate use of `eval` and `new Function()` 49 | "expr" : false, // true: Tolerate `ExpressionStatement` as Programs 50 | "funcscope" : false, // true: Tolerate defining variables inside control statements 51 | "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') 52 | "iterator" : false, // true: Tolerate using the `__iterator__` property 53 | "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block 54 | "laxbreak" : false, // true: Tolerate possibly unsafe line breakings 55 | "laxcomma" : false, // true: Tolerate comma-first style coding 56 | "loopfunc" : false, // true: Tolerate functions being defined in loops 57 | "multistr" : false, // true: Tolerate multi-line strings 58 | "noyield" : false, // true: Tolerate generator functions with no yield statement in them. 59 | "notypeof" : false, // true: Tolerate invalid typeof operator values 60 | "proto" : false, // true: Tolerate using the `__proto__` property 61 | "scripturl" : false, // true: Tolerate script-targeted URLs 62 | "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` 63 | "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation 64 | "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` 65 | "validthis" : false, // true: Tolerate using this in a non-constructor function 66 | 67 | // Environments 68 | "browser" : true, // Web Browser (window, document, etc) 69 | "browserify" : false, // Browserify (node.js code in the browser) 70 | "couch" : false, // CouchDB 71 | "devel" : true, // Development/debugging (alert, confirm, etc) 72 | "dojo" : false, // Dojo Toolkit 73 | "jasmine" : false, // Jasmine 74 | "jquery" : false, // jQuery 75 | "mocha" : true, // Mocha 76 | "mootools" : false, // MooTools 77 | "node" : false, // Node.js 78 | "nonstandard" : false, // Widely adopted globals (escape, unescape, etc) 79 | "phantom" : false, // PhantomJS 80 | "prototypejs" : false, // Prototype and Scriptaculous 81 | "qunit" : false, // QUnit 82 | "rhino" : false, // Rhino 83 | "shelljs" : false, // ShellJS 84 | "typed" : false, // Globals for typed array constructions 85 | "worker" : false, // Web Workers 86 | "wsh" : false, // Windows Scripting Host 87 | "yui" : false, // Yahoo User Interface 88 | 89 | // Custom Globals 90 | "globals" : { "chrome": true } // additional predefined global variables 91 | } -------------------------------------------------------------------------------- /Chrometana/js/options.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | "use strict"; 3 | var defaultSE = "Google.com"; 4 | var advanced_settings = document.getElementsByClassName('chrometana_advanced_setting'); 5 | var useCustomSearch = document.getElementById('useCustomSearch'); 6 | var custom_engine_settings = document.getElementById('custom_engine_settings'); 7 | var selectorList = document.getElementsByClassName('selector'); 8 | 9 | if (getURLVariable("newinstall") === "yes"){ 10 | var installadvice = document.getElementById('installadvice'); 11 | addClass(installadvice, 'visible'); 12 | } 13 | 14 | var optionCaller = function() { 15 | save_options('search_engine', this, this.getAttribute('value')); 16 | }; 17 | 18 | var handleMouseover = function() { 19 | var selectedElements = document.getElementsByClassName('hovering'); 20 | for (var i = 0; i < selectedElements.length; i++) { 21 | removeClass(selectedElements[i], 'hovering'); 22 | } 23 | var selected = document.getElementsByClassName('selected')[0]; 24 | removeClass(selected, 'hovering'); 25 | addClass(this, 'hovering'); 26 | 27 | }; 28 | 29 | var handleMouseout = function() { 30 | var selected = document.getElementsByClassName('selected')[0]; 31 | removeClass(this, 'hovering'); 32 | addClass(selected, 'hovering'); 33 | }; 34 | 35 | var advancedSettingsCaller = function() { 36 | var value; 37 | if(this.getAttribute("type") === "checkbox" || this.getAttribute("type") === "radio"){ 38 | if(this.checked){ 39 | value = true; 40 | } 41 | else{ 42 | value = false; 43 | } 44 | } 45 | save_options(this.id, this, value); 46 | }; 47 | 48 | function save_options(key, element, value){ 49 | var options = {}; 50 | options[key] = value; 51 | if(key === "custom_engine"){ 52 | if(value !== ""){ 53 | options.search_engine = "Custom"; 54 | } 55 | else{ 56 | options.search_engine = defaultSE; 57 | } 58 | } 59 | chrome.storage.sync.set(options, function() { 60 | restore_options(); 61 | }); 62 | } 63 | 64 | // Restores select box and checkbox state using the preferences 65 | // stored in chrome.storage. 66 | function restore_options() { 67 | chrome.storage.sync.get({ 68 | search_engine: defaultSE, 69 | custom_engine: '', 70 | enable_open_website: false, 71 | all_bing_searches: false, 72 | exclude_settings_app: true 73 | }, function(items) { 74 | updateDisplay(items); 75 | }); 76 | } 77 | 78 | function updateDisplay(items){ 79 | for (var i = 0; i < selectorList.length; i++) { 80 | if (selectorList[i].getAttribute('value') === items.search_engine) { 81 | addClass(selectorList[i], 'selected'); 82 | addClass(selectorList[i], 'hovering'); 83 | } 84 | else { 85 | removeClass(selectorList[i], 'selected'); 86 | } 87 | } 88 | if(items.search_engine === "Custom"){ 89 | useCustomSearch.checked = true; 90 | } 91 | else{ 92 | useCustomSearch.checked = false; 93 | } 94 | document.getElementById("custom_engine").value = items.custom_engine; 95 | updateCustomSearchView(); 96 | updateCheckBoxes(items); 97 | var status = document.getElementById('status'); 98 | addClass(status, 'updated'); 99 | status.textContent = 'New search engine preferences saved.'; 100 | setTimeout(function() { 101 | status.textContent = ''; 102 | removeClass(status, 'updated'); 103 | }, 1050); 104 | } 105 | 106 | function updateCheckBoxes(items){ 107 | for (var i = 0; i < advanced_settings.length; i++) { 108 | var id = advanced_settings[i].getAttribute("id"); 109 | if(id in items){ 110 | if(items[id] === true){ 111 | document.getElementById(id).checked = true; 112 | } 113 | else{ 114 | document.getElementById(id).checked = false; 115 | } 116 | } 117 | else if (id !== null){ 118 | document.getElementById(id).checked = false; 119 | } 120 | } 121 | } 122 | 123 | function updateCustomSearchView(){ 124 | if(useCustomSearch.checked){ 125 | addClass(custom_engine_settings, 'visible'); 126 | } 127 | else{ 128 | removeClass(custom_engine_settings, 'visible'); 129 | } 130 | } 131 | 132 | 133 | //Parses arguments from URL 134 | function getURLVariable(variable){ 135 | var query = window.location.search.substring(1); 136 | var vars = query.split("&"); 137 | for (var i = 0; i < vars.length; i++) { 138 | var pair = vars[i].split("="); 139 | if(pair[0] === variable){ 140 | return pair[1]; 141 | } 142 | } 143 | return(false); 144 | } 145 | 146 | function addClass(element, classNameToAdd) { 147 | if(typeof element!=="undefined"){ 148 | element.classList.add(classNameToAdd); 149 | } 150 | } 151 | 152 | function removeClass(element, classNameToRemove) { 153 | if(typeof element!=="undefined"){ 154 | element.classList.remove(classNameToRemove); 155 | } 156 | } 157 | 158 | // Add Event Listeners 159 | document.addEventListener('DOMContentLoaded', restore_options); 160 | 161 | for (var s = 0; s < selectorList.length; s++) { 162 | selectorList[s].addEventListener('click', optionCaller,false); 163 | selectorList[s].addEventListener('mouseover', handleMouseover, false); 164 | selectorList[s].addEventListener('mouseleave', handleMouseout, false); 165 | } 166 | 167 | useCustomSearch.addEventListener('click', function() { 168 | updateCustomSearchView(); 169 | if(!this.checked){ 170 | document.getElementById('custom_engine_update').click(); 171 | } 172 | }); 173 | 174 | for (var i = 0; i < advanced_settings.length; i++) { 175 | advanced_settings[i].addEventListener('click', advancedSettingsCaller, false); 176 | } 177 | 178 | document.getElementById('custom_engine_update').addEventListener('click', function() { 179 | var element = document.getElementById('custom_engine'); 180 | if(useCustomSearch.checked){ 181 | if(element.value.toLowerCase().indexOf("http") !== -1){ 182 | save_options('custom_engine', element, element.value); 183 | } 184 | else{ 185 | alert("Custom search engine must start with http"); 186 | } 187 | } 188 | else{ 189 | save_options('custom_engine', element, ""); 190 | } 191 | }); 192 | 193 | document.getElementById('additional-settings-toggle').addEventListener('click', function() { 194 | var settingsPane = document.getElementById('expandable_settings_pane'); 195 | var engines = document.getElementById('custom-engine-select'); 196 | 197 | if (settingsPane.className.search('open') >= 0) { 198 | removeClass(settingsPane, 'open'); 199 | removeClass(engines, 'hidden'); 200 | } 201 | else { 202 | addClass(settingsPane, 'open'); 203 | addClass(engines, 'hidden'); 204 | } 205 | }); 206 | }()); -------------------------------------------------------------------------------- /Chrometana/html/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #FFFFFF; 3 | color: #fff; 4 | font-family: 'Raleway',Tahoma,Verdana,Arial,sans-serif; 5 | 6 | } 7 | 8 | .content { 9 | position: relative; 10 | text-align: center; 11 | padding-bottom: 20px; 12 | } 13 | .fixed-top-right { 14 | position: absolute; 15 | top: 0px; 16 | right: 0px; 17 | z-index: 5; 18 | max-width:100%; 19 | max-height:70%; 20 | padding: 8px; 21 | background-color: #1c9fe7; 22 | border-bottom-left-radius: 10px; /* standards-compliant: (IE) */ 23 | } 24 | .centerlogo { 25 | padding-top: 20px; 26 | max-height: 130px; 27 | display: inline-block; 28 | } 29 | 30 | .title { 31 | margin-top: -20px; 32 | text-align: center; 33 | font-family: 'Raleway',Tahoma,Verdana,Arial,sans-serif; 34 | font-size: 40px; 35 | color: #03689d; 36 | vertical-align: center; 37 | } 38 | 39 | .subtitle { 40 | position: relative; 41 | padding-top: 10px; 42 | text-align: center; 43 | font-size: 25px; 44 | font-weight: 400; 45 | } 46 | 47 | .diagram { 48 | flex-direction: column; 49 | } 50 | 51 | .diagram > div { 52 | height: 100%; 53 | } 54 | 55 | .diagram img { 56 | height: 60%; 57 | margin: 0; 58 | display: block; 59 | } 60 | 61 | .diagram #webpage_diagram img { 62 | border-radius: 4px; 63 | height: 100%; 64 | } 65 | 66 | #webpage_diagram_placeholder { 67 | height: 100%; 68 | background-repeat: no-repeat; 69 | background-size: contain; 70 | background-position: center; 71 | transition: 0.5s; 72 | } 73 | 74 | .diagram #arrow_diagram { 75 | background-image: url("/images/Arrow.png"); 76 | content: "&arr;"; 77 | margin: auto; 78 | background-repeat: no-repeat; 79 | background-size: contain; 80 | background-position: center; 81 | } 82 | 83 | .selector div { 84 | text-align: center; 85 | height: 100%; 86 | border-radius: 40px; /* standards-compliant: (IE) */ 87 | } 88 | 89 | .selectorimage { 90 | cursor: pointer; 91 | padding: 10px; 92 | max-height: 80%; 93 | max-width:100%; 94 | vertical-align: middle; 95 | border-radius: 40px; 96 | -webkit-filter: grayscale(1); 97 | transition: 0.5s; 98 | opacity: 0.5; 99 | position: absolute; 100 | top: 0; 101 | bottom: 0; 102 | left: 0; 103 | right: 0; 104 | margin: auto; 105 | } 106 | 107 | .selector{ 108 | height: 100%; 109 | } 110 | 111 | .selected { 112 | border-radius: 50%; /* standards-compliant: (IE) */ 113 | border-style: solid; 114 | max-height: 120%; 115 | max-width: 120%; 116 | } 117 | 118 | .helper-text { 119 | padding-left: 2em; 120 | } 121 | 122 | .hovering img { 123 | -webkit-filter: grayscale(0); 124 | opacity: 1; 125 | } 126 | .selected img { 127 | /*-webkit-filter: grayscale(0);*/ 128 | max-height: 110%; 129 | box-sizing: content-box; 130 | } 131 | 132 | .settings-btn, 133 | .settings-btn:focus { 134 | color: white; 135 | background-color: #1c9fe7; 136 | width: auto; 137 | text-align: center; 138 | margin: 30px auto; 139 | display: table; 140 | font-size: 20px; 141 | } 142 | 143 | .settings-btn:hover, 144 | .settings-btn:active { 145 | color: white; 146 | background-color: rgba(128, 207, 232, 0.4); 147 | } 148 | 149 | #expandable_settings_pane #settings_container { 150 | overflow: hidden; 151 | height: auto; 152 | opacity: 0; 153 | display: none; 154 | animation: SETTINGS_CONTAINER_ANIMATION 0.5s reverse; 155 | } 156 | 157 | #expandable_settings_pane.open #settings_container { 158 | animation: SETTINGS_CONTAINER_ANIMATION 0.5s; 159 | opacity: 1; 160 | display: block; 161 | } 162 | 163 | @keyframes SETTINGS_CONTAINER_ANIMATION { 164 | 0% { 165 | opacity: 0; 166 | display: none; 167 | } 168 | 169 | 50% { 170 | opacity: 0; 171 | display: none; 172 | } 173 | 174 | 51% { 175 | opacity: 0; 176 | display: block; 177 | } 178 | 179 | 100% { 180 | opacity: 1; 181 | } 182 | } 183 | 184 | @keyframes DIAGRAM_ANIMATION { 185 | 0% { 186 | opacity: 1; 187 | display: block; 188 | } 189 | 190 | 50% { 191 | opacity: 0; 192 | display: block; 193 | } 194 | 195 | 51% { 196 | opacity: 0; 197 | display: none; 198 | } 199 | 200 | 100% { 201 | opacity: 0; 202 | display: none; 203 | } 204 | } 205 | 206 | #expandable_settings_pane.open { 207 | transition: 0.5s; 208 | transition-delay: 0.25s; 209 | background-color: #03689d; 210 | } 211 | 212 | #expandable_settings_pane.open #webpage_diagram { 213 | animation: DIAGRAM_ANIMATION 0.5s; 214 | display: none; 215 | opacity: 0; 216 | -webkit-backface-visibility: hidden; 217 | -webkit-transform: scale(1); 218 | } 219 | 220 | #expandable_settings_pane #webpage_diagram { 221 | animation: DIAGRAM_ANIMATION 0.5s reverse; 222 | display: block; 223 | opacity: 1; 224 | } 225 | 226 | #expandable_settings_pane { 227 | padding: 20px; 228 | border-radius: 10px; /* standards-compliant: (IE) */ 229 | 230 | } 231 | 232 | #status { 233 | height: 45px; 234 | text-align: center; 235 | font-size: 20px; 236 | color: rgb(36, 123, 171); 237 | margin-bottom: 15px; 238 | transition: 0.5s; 239 | opacity: 0; 240 | } 241 | 242 | #status.updated { 243 | transition: 0.5s; 244 | opacity: 1; 245 | } 246 | 247 | #installadvice { 248 | text-align: center; 249 | font-size: 18px; 250 | color: #03689d; 251 | margin: 10px 0; 252 | display: none; 253 | } 254 | 255 | .engines { 256 | height: 100px; 257 | margin-bottom: 30px; 258 | } 259 | 260 | #custom_engine_update { 261 | margin-top: 10px; 262 | } 263 | 264 | input[type="checkbox"] { 265 | margin-right: 10px; 266 | } 267 | 268 | .pull-right-button { 269 | float: right; 270 | } 271 | 272 | /*JS-free CSS3 transition voodoo magic*/ 273 | input.toggle { 274 | display: none; 275 | } 276 | 277 | #additional-settings-toggle.toggle ~ #additional_settings_container { 278 | max-height: 0; 279 | margin: .2rem; 280 | overflow: hidden; 281 | transition: 0.5s; 282 | background-color: rgba(154, 218, 246, 0.4); 283 | border-radius: 5px; /* standards-compliant: (IE) */ 284 | height: auto; 285 | } 286 | #additional-settings-toggle.toggle:checked ~ #additional_settings_container { 287 | max-height: 100%; 288 | } 289 | 290 | #additional_settings_container { 291 | font-size: 20px; 292 | } 293 | 294 | #additional_settings_container > form { 295 | padding: 10px; 296 | } 297 | 298 | #additional_settings_container input { 299 | margin: 5px; 300 | } 301 | #custom_engine_settings{ 302 | display:none; 303 | } 304 | a { 305 | color: #ffffff; 306 | } 307 | a:visited { 308 | color: #ffffff; 309 | } 310 | a:hover { 311 | color: #ffffff; 312 | } 313 | a:active { 314 | color: #ffffff; 315 | } 316 | .visible { 317 | display: block !important; 318 | } 319 | .pointer{ 320 | cursor: pointer; 321 | } 322 | .float-right{ 323 | float:right; 324 | } 325 | .float-left{ 326 | float:right; 327 | } 328 | .chrometana_advanced_setting{ 329 | font-weight: bold; 330 | } 331 | .option-text{ 332 | font-weight: bold; 333 | } 334 | section { 335 | margin-bottom:1em; 336 | } -------------------------------------------------------------------------------- /External assets/search_eng_images/DuckDuckGo_Logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml -------------------------------------------------------------------------------- /External assets/search_eng_images/Yahoo!_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 32 | 34 | 38 | 42 | 46 | 50 | 51 | 61 | 64 | 68 | 72 | 73 | 83 | 86 | 90 | 94 | 95 | 106 | 109 | 113 | 117 | 121 | 125 | 129 | 130 | 140 | 142 | 146 | 150 | 154 | 158 | 162 | 166 | 170 | 174 | 178 | 182 | 186 | 187 | 197 | 199 | 203 | 207 | 211 | 215 | 219 | 223 | 227 | 231 | 235 | 239 | 243 | 244 | 254 | 256 | 260 | 264 | 268 | 272 | 276 | 280 | 284 | 288 | 292 | 296 | 300 | 301 | 311 | 313 | 317 | 321 | 325 | 329 | 333 | 337 | 341 | 345 | 349 | 353 | 357 | 358 | 368 | 370 | 374 | 378 | 382 | 383 | 393 | 396 | 400 | 404 | 405 | 415 | 417 | 421 | 425 | 429 | 430 | 440 | 443 | 447 | 451 | 452 | 462 | 465 | 469 | 473 | 477 | 478 | 488 | 490 | 494 | 498 | 499 | 509 | 511 | 515 | 519 | 523 | 527 | 531 | 532 | 542 | 545 | 549 | 553 | 554 | 564 | 566 | 570 | 574 | 578 | 582 | 586 | 587 | 597 | 600 | 604 | 608 | 609 | 619 | 622 | 626 | 630 | 631 | 641 | 644 | 648 | 652 | 653 | 663 | 665 | 669 | 673 | 674 | 684 | 687 | 691 | 695 | 696 | 706 | 709 | 713 | 717 | 718 | 727 | 730 | 734 | 738 | 742 | 743 | 753 | 754 | 776 | 778 | 779 | 781 | image/svg+xml 782 | 784 | 785 | 786 | 787 | 788 | 793 | 799 | 805 | 811 | 817 | 823 | 829 | 835 | 841 | 847 | 853 | 859 | 865 | 871 | 876 | 882 | 888 | 894 | 900 | 906 | 912 | 918 | 924 | 930 | 935 | 940 | 945 | 950 | 956 | 962 | 968 | 974 | 980 | 986 | 992 | 998 | 1004 | 1014 | 1015 | 1016 | --------------------------------------------------------------------------------
Enable abilty to search "Open example.com" and load example.com
Redirect all searches sent to bing (including Cortana)
Only redirect searches that come from Cortana