obsidian-web-browser
obsidian-web-browser copied to clipboard
feat: support basic context menu
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