OtterBrowser / otter-browser

Otter Browser aims to recreate the best aspects of the classic Opera (12.x) UI using Qt5
https://otter-browser.org
GNU General Public License v3.0
1.82k stars 278 forks source link

Text selection inside links #109

Open unxed opened 10 years ago

unxed commented 10 years ago

Opera 12 has an ability to select text placed inside A tag. It would be nice to have the same option included in Otter Browser.

Stng84 commented 10 years ago

Fore surely, it's "must have" feature

Emdek commented 10 years ago

This one is not really doable. :-/ It is issue in WebKit itself, I have no idea if they even consider that as bug... And I doubt if it would be possible with some custom JS based workarounds.

srgloureiro commented 10 years ago

+50 to this feature!

Emdek commented 10 years ago

You can try to report it upstream (I couldn't fin existing ticket for this issue) and post link to issue in comments. https://bugs.webkit.org/

unxed commented 10 years ago

Is it possible to implement such behavour on a top of Gecko engine?

Emdek commented 10 years ago

@unxed, I guess it has to be implemented in engine itself, AFAIK only Presto allowed this behavior... And first we would need Qt bindings for Gecko, previous attempt wasn't finished and is very outdated. :-/

beastie1 commented 10 years ago

@Emdek, I found this blog post today. It is about an extension for Blink-Chropera that supposedly allows selection inside hyperlinks.

Considering the origin of Blink, could a similar workaround be coded for Otter? Would it be too much trouble? Do you think it may have a negative impact on performance?

Emdek commented 10 years ago

@beastie1, interesting. If it works (haven't tested yet) then it should be doable, but it will be hard to duplicate since source is a bit obfuscated.

srgloureiro commented 10 years ago

From my experience, I think the Old Opera works like this:

vlad-ivanov-name commented 10 years ago

@Emdek

Source can be easily deobfuscated, I'll post a gist with the deobfuscated version today.

vlad-ivanov-name commented 10 years ago

http://pastebin.com/781MeCvX

Haven't tested it. If javascript-based solution is acceptable, I can write something like this. By the way, should script-based link text selecting be optional? Maybe there should be some options in about:config.

Emdek commented 10 years ago

@resetnow, I would like to avoid adding option for that. If such solution would simply always work then it could be embedded in QtWebKit backend. If there would be occasional issues then it could be shipped as user script that could be enabled by user.

vlad-ivanov-name commented 10 years ago

@Emdek, I think this script will work almost always. However, native solution would be better, but looks like there's no way to implement it without modifying webkit sources.

Emdek commented 10 years ago

@resetnow, maybe Opera developers will someday implement that in Blink. ;-) For now such workaround should be enough.

rplnt commented 10 years ago

The blog linked above seems to be updated with this extension https://gist.github.com/Griever/5005165 I haven't tested it.

I also want to mention I find this a quite serious usability issue (more important than missing mail client for example). I see how it's not feasible to maintain own WebKit fork (assuming it's reasonably fixable in there) at this stage, but I wouldn't close this just yet (unless the js workaround works properly).

Emdek commented 10 years ago

@rplnt, this version looks more promising. About closing upstream issues, we should have wiki page listing known upstream issues, with links to upstream bug reports.

Emdek commented 7 years ago

Since we have User Script for some time already we could do it as bundled and enabled by default User Script. But first we would need some JS code with proper license...

pierreporte commented 7 years ago

@resetnow proposed to do it in his comment. He seems to be active on Github so maybe he could do it?

vlad-ivanov-name commented 7 years ago

The script mentioned above (https://gist.github.com/Griever/5005165) works just fine for me, at least with QtWebEngine. It's also MIT licensed, is this license compatible with Otter?

pierreporte commented 7 years ago

According to the GNU project, the MIT license is a name given to either the X11 license and the Expat. Both are compatible with the GPL v3 that Otter uses.

https://www.gnu.org/licenses/license-list.html#X11License https://www.gnu.org/licenses/license-list.html#Expat

pierreporte commented 7 years ago

If we are going to provide official user scripts, it may be a good idea to indicate which scripts are provided by default and are officially supported, and which are not.

Emdek commented 7 years ago

Right, somehow I remembered that there was only some totally unreadable JS code to solve that... And now I don't even see link to that solution in this ticket, probably I've seen it only during early research.

unxed commented 7 years ago

http://pastebin.com/781MeCvX

this one?

Emdek commented 7 years ago

@unxed, no, I remember something obfuscated or at least minified, either someone gave me link outside this ticket or I've found it on the net.

unxed commented 7 years ago

https://github.com/eight04/select-text-inside-a-link-like-opera ? https://greasyfork.org/ru/scripts/789-select-text-inside-a-link-like-opera/code ?

Emdek commented 7 years ago

@unxed, nope, and there is no point for looking it up now. ;-)

vlad-ivanov-name commented 7 years ago

A previous version of the extension mentioned above (which is now removed) was obfuscated.

beastie1 commented 7 years ago

You're talking about the one mentioned here.

Emdek commented 7 years ago

@resetnow, @beastie1, yeah, probably that one.