notlmn / copy-as-markdown

🖱 Browser extension to copy hyperlinks, images, and selected text as Markdown with GFM support
MIT License
323 stars 48 forks source link

Copy as Markdown sometimes missing from Firefox context menu #30

Closed sinewalker closed 1 year ago

sinewalker commented 1 year ago

I haven't been able to reproduce this reliably, sorry. Just noting observations and a workaround.

Sometimes when I select text in a page, then right click to copy-as-markdown, the menu item "Copy selection as Markdown" is missing from Firefox's context menu.

I have made sure the extension is allowed in private windows (though this happens on non-private windows).


What I have found fixes this, is to disable and then re-enable the extension, then reload the web page.


After reload and selecting the same text, the menu item is available and the copy-as-markdown works as usual.

(thank you for this extension, I use it a lot!)

notlmn commented 1 year ago

We show the option only in certain contexts.

Depending on where you right click after selecting a piece of text (that may include images, video, audio, or other stuff), the context menu gets added or not.

Our code only adds the context menu when you right click on an image, link, or just text selection.

You can try right clicking at a different position after making a selection to see if this is the case. You can try sharing a link to the page that you are testing this on for me to test.

sinewalker commented 1 year ago

Thank you :) I'm not sure that I can share a link (private web site) but I'll keep my eyes open for when this happens again, make sure to click on the text, and if it's a public web site then I'll share it.

sinewalker commented 1 year ago

I was beginning to think that this must be a user error, but I finally found an example

https://docs.gitlab.com/ee/ci/jobs/ci_job_token.html#limit-your-projects-job-token-access

right-clicking on the link scheduled for removal produces a context menu with the Copy as Markdown missing.

Indeed it is missing from anywhere in the page.

Disable/Enable, reload the page, and it's working again.

I'm still not convinced that this is a real bug and not just my mistake though ¯_(ツ)_/¯

notlmn commented 1 year ago

Looks like you got it working.

inxomnyaa commented 1 year ago

This still appears to happen, but on every browser restart, on any page. I have to click the extension icon in the toolbar, after that the context menu appears and always works perfectly fine, until you restart the browser again

brawaru commented 11 months ago

If you have extension in the menu you'll see that this is because of permissions (‘Permission needed to read and change data’). Firefox extensions are granted permission to run on the current page only when you click on the icon, which is quite annoying, because for Copy as Markdown, it opens this GitHub repository page.

However, I've seen many other extensions bypass this somehow, so I assume there's another permission that this extension can request during install to run on all pages without need to click it in toolbar.

jasonmobley commented 10 months ago

Came here to post the same, it seems like there is a permission this extension could request that would allow it to work without being reactivated manually after firefox restarts/updates. It seems like every other time I want to copy a link as markdown I first have to go click the extension in the extensions toolbar menu again.