Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Add a way to open custom context menu #245

Open
brrd opened this issue May 10, 2018 · 0 comments
Open

Add a way to open custom context menu #245

brrd opened this issue May 10, 2018 · 0 comments

Comments

@brrd
Copy link
Owner

brrd commented May 10, 2018

Would be useful for spelling suggestion/add to dictionary, images, etc.

My idea:

// abr-document.js
// Listener for context menu
  document.addEventListener("contextmenu", function () {
    var context = // check stuffs about sursor position and return a string such as "misspelled"
    ipcClient.trigger("openContextMenu", context);
  }, false);

Then in menu-context.json:

{
  "labelKey": "menu-add-to-dictionary",
  "command": "addToDict",
  "context": "misspelled"
},

Finally, hide/show menu entries depending on context when context menu is displayed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant