brandly / Lax

IRC client built with Electron & React
https://github.com/brandly/Lax
MIT License
139 stars 26 forks source link

links not working correctly #89

Closed brandly closed 4 years ago

brandly commented 4 years ago

i clicked a link someone shared. it took over the electron window instead of opening (safely) in a browser

i was using the v0.6.4 build

sri-rang commented 4 years ago

Yep, I see this as well. I don't mind the behavior, as long as there's a back button.

But I guess the expected behavior is to open in default browser.

brandly commented 4 years ago

But I guess the expected behavior is to open in default browser.

Yes! I swear it used to behave like this. I don’t think I’ve touched anything over there in a while, so maybe updating Electron itself broke it. It’s probably not a difficult fix.

sri-rang commented 4 years ago

I see you're using shell.openExternal which seems correct. Perhaps the event is bubbling up to react-linkify nevertheless.

sri-rang commented 4 years ago

Curious if we need handleLink() at all. Does does passing target: '_blank' not behave within the Electron shell?

brandly commented 4 years ago

@srirangan thanks for chiming in, helped motivate me to actually do something lol

the latest version of react-linkfy doesn't seem to take a properties prop at all. instead of figuring out if there's a new approach, i just rolled back.

after rolling back, i tried the target: '_blank' approach, since i thought that'd be nice. however, that opened a second electron window with the site in it. with openExternal, it takes you to your real browser.

brandly commented 4 years ago

Lax v0.6.5 should be out soon. try it out and lmk if it works well for you. thanks again! ✨

sri-rang commented 4 years ago

Thank you @brandly