-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent downloading image by clicking on view image #261
Comments
This will probably have an adverse effect at some point, but if this is implemented I think might as well try a more general approach where you just capture the url until the first argument, using This would make Although there are probably cases where genuine images are linked using arguments like image key or id, and so my suggestion would screw those. The other approach is too specific and would only fix one website at a time, and that would get out of hand pretty quickly. |
Here's another quick example where a general approach would be favorable: Currently this will show you a downsized image when clicking the "View Image" button, due to the url arguments: |
Then you have those where neither approach works: |
The last one you showed is indeed a tricky one. I don't think there is a method that would cover multiple sites, since the transformation of the link is fairly substantial here:
|
Yeah, and I wouldn't worry much about it, all I'm saying is that it isn't possible to cover all bases but the issue you raised is a good one and we should try to maximize the functionality for a diversity of cases without compromising the worst case: direct download of the image. |
Example image:
https://www.google.com/search?q=images&tbm=isch&ved=2ahUKEwijwZP6gpL5AhWtPOwKHWSMDekQ2-cCegQIABAA&oq=images&gs_lcp=CgNpbWcQAzIFCAAQgAQyBQgAEIAEMgUIABCABDIFCAAQgAQyBQgAEIAEMgUIABCABDIFCAAQgAQyBQgAEIAEMgUIABCABDIFCAAQgAQ6BAgAEENQvAVYsgdgsAloAHAAeACAAZgBiAH2BZIBAzQuM5gBAKABAaoBC2d3cy13aXotaW1nwAEB&sclient=img&ei=s33dYuObAa35sAfkmLbIDg&bih=920&biw=959&rlz=1C1GCEA_enHU985HU985&hl=en#imgrc=2nDXavJs9DoKTM
When you click on the button, it downloads the image. I would suggest using a regex like this one, then replacing the href.
let regex = /(\&dl)(.*?)(?=&)/; // "&dl" + everything after it just before another "&"
The text was updated successfully, but these errors were encountered: