qsniyg / maxurl

Finds larger/original versions of images and videos
https://qsniyg.github.io/maxurl/
Apache License 2.0
1.12k stars 69 forks source link

Add options for linked image #435

Closed lnp5131 closed 10 months ago

lnp5131 commented 4 years ago

This can give the popup interaction more versatility on what to do when clicked. Possible options could be copy link into clipboard, open link in current tab, a new window, or a new tab, which is the current action. As mentioned in #430, adblockers target a[target="_blank"] > img, this may also double as an option to workaround it so long as it doesn't open it in a new tab.

qsniyg commented 4 years ago

(Sorry for the late reply)

Good ideas!

As you mentioned in your other comment, it'd be interesting to have a javascript-based solution as a fallback option. And yeah, it would also allow to open in a new window. That being said, I'm not too comfortable with keeping that as the default, since it's quite common for adblockers to disable window.open. Of course, other solutions are possible, such as injecting an <a> element and clicking it (which is the fallback for the userscript when GM_download is missing or unused), or using the native open tab function through the userscript and the extension (though some userscript managers don't support it, so a fallback will need to be used). Additionally, I think it's nice for it to be a link, as then the user can just expect it to work like other links (right click->copy link address, etc.). But having that as an option, absolutely! :)

copy link into clipboard

I thought I had opened an issue for that a while back, but I guess not haha. Good idea! That being said, it will need to be manually enabled by the user for the extension, as it'll need to be an optional permission (otherwise, all users of the extension will be greeted with a "to continue using this addon, you need to grant it access your clipboard" which... is a little bit of a scary message haha). Additionally, I guess a "copy caption" key would also be useful (similar to what already exists in imagus)

lnp5131 commented 4 years ago

Oh I didn't even know Imagus had that. I'm glad you mentioned Imagus though because I found out about this as I was trying to find a replacement as it was no longer in development and was quite buggy. It's why I want to contribute as much as I can.

In any case, I don't think people are concerned with permissions often. They are more concerned with the average reviews or purely the bad reviews imo. Do adblockers differentiate from each other to a large extent? If so, having several fallbacks doesn't seem to be a bad idea.

qsniyg commented 4 years ago

It's why I want to contribute as much as I can

I honestly really appreciate it, thank you!! I only personally use it in certain ways, so I often miss what could be a useful feature, or any bugs/regressions that don't occur under my setup (for example, the repeating popup bug you sent).

I don't think people are concerned with permissions often

For those installing, true. But the issue is that it will disable the addon and give a dialog saying "in order to use this addon, you must grant it full access to your clipboard", which is a little disconcerting, especially for a feature that most people won't use. If I could explain what the feature was used for in the popup, it'd make sense, but e.g., if you look at Imagus's bad reviews, quite a lot of them stemmed from it asking access to the browser history. It needed that permission in order to add links to the browser history, which was an optional feature (which iirc is enabled by default). So I'll just go for an optional permission instead... that way it'll only ask for access once you enable the option (in which case, it'll become very clear what the permission is used for).

Do adblockers differentiate from each other to a large extent?

I don't think so (but I could be wrong, I'm not super familiar with them honestly haha), they all use similar filter lists, but I'm guessing some support more than others (iirc ublock has special filter syntaxes for it). The main issue that I'm aware of is that each filter can do different things on websites. They can sometimes block various javascript functionality (e.g. the Math family of functions on gfycat, or event listeners on xhamster where the event listening function has, iirc open in the function body), and sometimes they can add various css styles (such as gelbooru, or div[display="block"] ... on pornhub)

lnp5131 commented 4 years ago

I think that opt in approach would be great in general to anything that requires additional permissions. It would make sense given quite a few malicious extensions have made the news. I'm still unaware of how their injected styles have a higher precedence than inline styles when they both have the !important tag. I also didn't know it would ask for permissions even as an extension at the time of using the option and not only at installation. That would help the users who are interested to be well informed.

qsniyg commented 10 months ago

Two of the four features (open in new tab and copy link to clipboard) have already been implemented.

The last two will be tracked here: https://github.com/qsniyg/maxurl/issues/310 (current tab) and https://github.com/qsniyg/maxurl/issues/1247 (new window)

Thanks again for the suggestions!