Skip to content

Commit

Permalink
Fix disappearing context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuupy committed Aug 21, 2018
1 parent d192d23 commit 068b02e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ action("brave-extension") {
outputs = [
"$target_gen_dir/brave_extension/build/background.html",
"$target_gen_dir/brave_extension/build/js/background.bundle.js",
"$target_gen_dir/brave_extension/build/js/content.bundle.js",
"$target_gen_dir/brave_extension/build/js/braveShieldsPanel.bundle.js",
"$target_gen_dir/brave_extension/build/braveShieldsPanel.html",
"$target_gen_dir/brave_extension/build/bravelizer.css",
Expand Down
51 changes: 24 additions & 27 deletions app/background/events/cosmeticFilterEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,30 @@ let rule = {
selector: ''
}

// add context menu
chrome.runtime.onInstalled.addListener(function () {
// parent menu
chrome.contextMenus.create({
title: 'Brave',
id: 'brave',
contexts: ['all']
})
// block ad child menu
chrome.contextMenus.create({
title: 'Block element via selector',
id: 'addBlockElement',
parentId: 'brave',
contexts: ['all']
})
chrome.contextMenus.create({
title: 'Clear CSS rules for this site',
id: 'resetSiteFilterSettings',
parentId: 'brave',
contexts: ['all']
})
chrome.contextMenus.create({
title: 'Clear CSS rules for all sites',
id: 'resetAllFilterSettings',
parentId: 'brave',
contexts: ['all']
})
// parent menu
chrome.contextMenus.create({
title: 'Brave',
id: 'brave',
contexts: ['all']
})
// block ad child menu
chrome.contextMenus.create({
title: 'Block element via selector',
id: 'addBlockElement',
parentId: 'brave',
contexts: ['all']
})
chrome.contextMenus.create({
title: 'Clear CSS rules for this site',
id: 'resetSiteFilterSettings',
parentId: 'brave',
contexts: ['all']
})
chrome.contextMenus.create({
title: 'Clear CSS rules for all sites',
id: 'resetAllFilterSettings',
parentId: 'brave',
contexts: ['all']
})

// contextMenu listener - when triggered, grab latest selector
Expand Down

0 comments on commit 068b02e

Please sign in to comment.