Monitor clipboard and fix localhost URL on the fly?
#859 opened on Apr 2, 2020
Repository metrics
- Stars
- (1,992 stars)
- PR merge metrics
- (Avg merge 53d 3h) (1 merged PR in 30d)
Description
Is your feature request related to a problem? Please describe.
When user wants to share link, they usually copy URL from address bar. This brings UX issue when resource was loaded from local IPFS node running on user's machine.
Describe the solution you'd like
While we have a menu option for copying a shareadble link (https://github.com/ipfs-shipyard/ipfs-companion/issues/857), many users copy URL from location bar, which has *.localhost:8080 host instead of a publicly aavailable gateway.
Describe alternatives you've considered
Improving menu item label is tracked in https://github.com/ipfs-shipyard/ipfs-companion/issues/857 but does not solve the problem of user copying URL from address bar.
Additional context
- AFAIK there is no browser extension API for manipulating clipboard in Chromium.
- Firefox has one that enables extension to write an image to the clipboard: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/clipboard
- Something to research: see if generic Web API is availabe in the background page of the browser extension and can be used for monitoring system clipboard and fixing localhost URLs on the fly: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard#Reading_from_the_clipboard