How to disable images to download?
See original GitHub issueI tried to use the code, but it didn’t work.
// disable images to download
await page.SetRequestInterceptionAsync(true);
page.Request += (sender, e) =>
{
if (e.Request.ResourceType == ResourceType.Image)
e.Request.AbortAsync();
else
e.Request.ContinueAsync();
};
error like this:
Protocol error(Page.navigate): Target closed. (NetworkManager failed to process Fetch.requestPaused. Value cannot be null.
Parameter name: key. at System.Collections.Concurrent.ConcurrentDictionary`2.ThrowKeyNullException()
at System.Collections.Concurrent.ConcurrentDictionary`2.set_Item(TKey key, TValue value)
at PuppeteerSharp.NetworkManager.OnRequestPausedAsync(FetchRequestPausedResponse e)
at PuppeteerSharp.NetworkManager.Client_MessageReceived(Object sender, MessageEventArgs e))
environment:
dotnet core 2.2
vs 2019
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Protect image download - html
Protect image download · 1. Disable the Right Click on all Images. let allImages = document.querySelectorAll("img"); allImages.forEach((value)=>{ ...
Read more >How to prevent pictures from being downloaded by right- ...
Right click on the webpage in Chrome, press Inspect , then find the directory where the image is stored by browsing thumbnails, then...
Read more >How To Protect Your Website From Image Theft
The easiest way to download images is by right-clicking on them and selecting “save image”. While it's still easy enough to download images...
Read more >Preventing visitors from downloading your images, videos ...
Disable right-clicks ... We don't recommend this option because it creates a false sense of security and in no way prevents screenshots, drag-and- ......
Read more >how to disable download option from google site
If you have an image on your site and people can see it then their computer or mobile device has already downloaded it....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
code like this. use local chrome.
Thank you for your answer. Maybe I misunderstood the versions of chrome and chromium. 😦