├── .gitignore ├── src ├── 16x16.png ├── 32x32.png ├── 48x48.png ├── background.html ├── background.js ├── manifest.json ├── options.js ├── options.html └── crossfire-chrome.js ├── README └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | *.pem 2 | *.zip 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /src/16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mozlima/crossfire-chrome/master/src/16x16.png -------------------------------------------------------------------------------- /src/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mozlima/crossfire-chrome/master/src/32x32.png -------------------------------------------------------------------------------- /src/48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mozlima/crossfire-chrome/master/src/48x48.png -------------------------------------------------------------------------------- /src/background.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/background.js: -------------------------------------------------------------------------------- 1 | (function(document){ 2 | chrome.extension.onRequest.addListener( 3 | function(request, sender, sendResponse) { 4 | switch (request.name) { 5 | case "getPreferences": 6 | var value = localStorage["mode"]; 7 | if (!value) { value = "default"; }; 8 | sendResponse({mode: value}); 9 | break; 10 | } 11 | } 12 | ); 13 | })(document); 14 | -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "content_security_policy": "script-src 'self'; object-src 'self'", 4 | "content_scripts": [ 5 | { 6 | "js": [ "crossfire-chrome.js" ], 7 | "run_at": "document_end", 8 | "matches": [ "http://*/*", "https://*/*" ] 9 | } 10 | ], 11 | "version": "0.2.6", 12 | "name": "CrossFire for Google Chrome™", 13 | "options_page": "options.html", 14 | "background": { 15 | "script" : "background.js", 16 | "page" : "background.html" 17 | }, 18 | "description": "CrossFire (Opera Spatial Navigation) for Chrome.", 19 | "icons": { "16": "16x16.png", 20 | "32": "32x32.png", 21 | "48": "48x48.png", 22 | "128": "48x48.png" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/options.js: -------------------------------------------------------------------------------- 1 | (function(document) { 2 | document.addEventListener('DOMContentLoaded', function(e) { 3 | document.getElementById("button").addEventListener('click', function(e) { 4 | e.preventDefault(); 5 | save_options(); 6 | }, false); 7 | 8 | restore_options(); 9 | }, false); 10 | 11 | 12 | function save_options() 13 | { 14 | var select = document.getElementById("mode"); 15 | localStorage["mode"] = select.value; 16 | var status = document.getElementById("status"); 17 | status.innerHTML = "Settings have been saved."; 18 | setTimeout(function(e) { 19 | status.innerHTML = ""; 20 | }, 1500); 21 | } 22 | 23 | function restore_options() 24 | { 25 | var mode = localStorage["mode"]; 26 | if (!mode) { return; } 27 | var select = document.getElementById("mode"); 28 | select.value = mode; 29 | } 30 | })(document); 31 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | CrossFire for Google Chrome™ allows you to move to the next link with a keyboard. 2 | This method is called "Spatial Navigation" in Opera and "CrossFire" in Firefox Addons. 3 | 4 | Usage: 5 | Shift + Up : navigate up 6 | Shift + Down : navigate down 7 | Shift + Left : navigate left 8 | Shift + Right : navigate right 9 | Enter: navigate the focused link 10 | 11 | History: 12 | 0.2.6: 13 | add ignoring if event.defaultPrevented == true (thanks github.com/ijprest!) 14 | 0.2.5: 15 | add ignoring Content editable documents (thanks github.com/takuya!) 16 | 0.2.4: 17 | update manifest version 18 | 0.2.3: 19 | highlight by extension 20 | rename extension name 21 | 0.2.2: 22 | option page to change keybindings 23 | 0.2.1: 24 | work on https://* 25 | show the icon in chrome:extensions page 26 | 27 | Authors: 28 | mallowlabs