Skip to content

Instantly share code, notes, and snippets.

@sweeneyapps
Last active October 26, 2016 23:34
Show Gist options
  • Save sweeneyapps/1b122cce0502676ff7e2032985c69191 to your computer and use it in GitHub Desktop.
Save sweeneyapps/1b122cce0502676ff7e2032985c69191 to your computer and use it in GitHub Desktop.
Context Menu for Rainforest
// enable 'contextMenus' in permission (manifest.json)
const rootID = chrome.contextMenus.create({
type: 'normal', /* "normal", "checkbox", "radio", or "separator" */
title: 'Sound Notification',
contexts: ['browser_action'],
checked: false,
onclick: (info, tab) => {
},
}, () => {});
chrome.contextMenus.create({
type: 'radio',
id: 'repeatOne',
title: '1 x Sound Repeat',
contexts: ['browser_action'],
checked: false,
onclick: (info, tab) => {
store.dispatch(setSoundRepeat(info.menuItemId));
},
parentId: rootID,
}, () => {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment