hnakamur / FormatLink-Firefox

A Firefox web-extension to copy the URL and the title or the selected text to clipboard
https://addons.mozilla.org/ja/firefox/addon/format-link3/
MIT License
45 stars 8 forks source link

`url` variable becomes unintended URL accidentally on some websites. #40

Closed kanonji closed 4 years ago

kanonji commented 4 years ago

url variable becomes unintended URL accidentally on some websites. For this issue, I describe with a website of https://toyokeizai.net/. I have experienced similar issue on another website few months ago.

I guess this issue is difficult to fix because this may be depends on how websites made. I report this issue just in case.

What I did

  1. Open https://toyokeizai.net/
  2. Use Format Link and get title and URL text properly.
  3. Click left margin area of the website at least once.
  4. Use Format Link and get wrong URL https://corp.toyokeizai.net/privacy-policy/.
  5. Click right margin area of the website at least once.
  6. Use Format Link and get wrong URL http://corp.toyokeizai.net/recruit/.

I guess both two wrong URLs may come from links in website footer.

What I get on step 2.

147OBrFGiV

What I get on step 4.

yZMgXZ13xc

Workaround

Use page_url variable instead of url.

hnakamur commented 4 years ago

Hi @kanonji, thank you very much for your detailed bug report. I fixed the problem at Use link only when text is selected by hnakamur · Pull Request #41 · hnakamur/FormatLink-Firefox and published it as version 5.1.1.

Could you try again when version 5.1.1 is published?

kanonji commented 4 years ago

I have updated the Format Link add-on and confirmed that I can get right URL on step2, step4 and step6 with url variable. Thank you, I appreciate it.