Created
October 17, 2014 18:38
-
-
Save epitron/6fb17c32bbc1c714c420 to your computer and use it in GitHub Desktop.
Sample Chrome Extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
chrome.commands.onCommand.addListener(function(command) { | |
console.log('onCommand event received for message: ', command); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a sample browser action popup. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Sample Extension Commands extension", | |
"description": "Press Ctrl+Shift+F (Command+Shift+F on a Mac) to open the browser action popup, press Ctrl+Shift+Y to send an event (Command+Shift+Y on a Mac).", | |
"version": "1.0", | |
"manifest_version": 2, | |
"background": { | |
"scripts": ["background.js"], | |
"persistent": false | |
}, | |
"browser_action": { | |
"default_popup": "browser_action.html" | |
}, | |
"commands": { | |
"toggle-feature": { | |
"suggested_key": { "default": "Ctrl+Shift+Y" }, | |
"description": "Send a 'toggle-feature' event to the extension" | |
}, | |
"_execute_browser_action": { | |
"suggested_key": { | |
"default": "Ctrl+Shift+F", | |
"mac": "MacCtrl+Shift+F" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment