radical-native icon indicating copy to clipboard operation
radical-native copied to clipboard

Hijack matrix.to and well-known riot.im urls

Open D4ndellion opened this issue 5 years ago • 3 comments

When you self-host riot its sometimes neccecary to a little copy paste dance when you see a matrix.to url, or if someone posts a link to riot.im/app#sometimestamp in riot.

Having Radical Native hijack the urls and maybe just opening them in the already opened tab would be a great feature!

D4ndellion avatar Feb 24 '20 11:02 D4ndellion

Something more generic that might fit this use-case: https://addons.mozilla.org/firefox/addon/requestcontrol/ - that allows adding pretty sophisticated redirect rules.

Concerns regarding adding it directly to Radical Native:

  • Intercepting/Replacing arbitrary links on third-party sites would require <all_urls> permissions, which given that we talk to a binary on the host might not be ideal security-wise
  • Doing search&replace in Riot itself for arbitrary Riot links would be fuzzy at best
  • RN could be active for multiple Riots, in which case some sort of choice has to be made, making it harder UI/UX-wise

Possible alternative:

  • Right-click on links matching a certain pattern could show a menu that reveals list of tabs where RN is active and allows opening the link in that tab (by changing the hash), but that would still require the <all_urls> permission.

stoically avatar Feb 24 '20 11:02 stoically

Another option is to only need data for matrix.to and edit the web page, adding links to the riots RN is active for at the top of the clients list.

Then you could notice when the user clicks on it and change that tabs hash/open it in a new tab

this doesn't really solve the replacing stuff in riot problem, but I think its a pretty good UI, and also limits the scope quite nicely.

D4ndellion avatar Feb 24 '20 13:02 D4ndellion

Nice idea. I seem to remember that there was some discussion in #synchronicity:mozilla.org around changing matrix.to to support different riot instances. Maybe if they'd allow passing additional riot instances that'd be more sane than modifying the HTML from an Add-on.

stoically avatar Feb 24 '20 13:02 stoically