Open marcocevoli opened 11 months ago
As the webshot functionality is really just firing up a browser and taking a screenshot, it's going to show whatever your site shows to a new user. The best option would be to disable the cookie banner for the webshot useragent. I'm not 100% sure what this is off the top of my head, but inspecting your webserver logs would show the useragent used for webshotting, and that is what you could use to determine if you should hide the banner.
Not a great answer I know, but it's the best I can come up with righ tnow 🤷🏻
If I'm not mistaken, the user agent can be now set in the Admin panel of SEO Magic. By default it's "Grav SEOMagic Plugin". I tried to hide the banner through a JavaScript, but I must be doing something wrong, because it isn't working.
I don't know if I'm the only one having this issue, but if others found a way to solve it, I'll be glad to hear from them. :)
Sorry to revive this old issue, but I haven't found a reliable way to tackle it.
Would it be too much to ask to add an option in the YAML file, such as webshot_css: .cookie-banner {display: none !important}
and then adding a line in the SEOMagic.php, so that the css is injected in the request?
I've tried the user agent approach with no luck. BTW, we're using Iubenda for the cookie banner, if this might help.
TIA
Hi,
Page screenshots generated by WebShot include our (ugly :) ) cookie banner. Is there any trick to get rid of it from the screenshots?
See https://i.imgur.com/Ejf2tSa.png (taken from a LinkedIn message)
TIA, Marco