Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support basic context menu #42

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Quorafind
Copy link
Contributor

@Quorafind Quorafind commented Nov 9, 2022

resolved: #39

In this pr:

webview context menu support three main (basic) features:

  • Open current URL in external browser
  • Copy Text
  • Copy Highlight link (based on text-fragment from chrome features? chromium features)

And I did try to use Obsidian default context menu api, I found it is diffcult to handle the context menu life cycle because when we click on the iframe in the webview, obsidian didn't react to it.

And there are still some features / command to be added into the context menu.


var urlRegEx2 = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(:[0-9]+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/g;

is used for detect url like : https://github.com/Trikzon/obsidian-web-browser/compare/main...Quorafind:obsidian-web-browser:feature/webview-context-menu?expand=1#diff-62273fc3fd92e90a0259fd41071a9a4114ec24773a46aff160f748c2376128faR209

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

Successfully merging this pull request may close these issues.

Show context menu when right click on the webview.
1 participant