getgrav / grav-premium-issues

Official Grav Premium Issues repository to report problems or ask questions regarding the Premium products offered.
https://getgrav.org/premium
7 stars 2 forks source link

[seo-magic] WebShot screenshot shows cookie banner. How to get rid of it? #402

Open marcocevoli opened 7 months ago

marcocevoli commented 7 months ago

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

rhukster commented 6 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 🤷🏻

marcocevoli commented 4 months ago

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. :)