scullyio / scully

The Static Site Generator for Angular apps
https://scully.io/
MIT License
2.55k stars 257 forks source link

Scully GDPR Modal Workaround #801

Closed moritz31 closed 4 years ago

moritz31 commented 4 years ago

🐞 Bug report

Description

On my page i have a gdpr consent modal, that displays and disable all site actions. When scully serves the static site, the modal is shown, after the angular app is loaded the modal goes away.

Not sure if this is a bug or a feature request or just an advice on how to workaround that issue.

🔬 Minimal Reproduction

Create a simple page with modal in front, which hides when a cookie is set. Accept the cookie and then reload the site.

💻Your Environment

Angular Version:




Angular CLI: 9.1.8
Node: 12.18.3
OS: darwin x64

Angular: 9.1.11
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.8
@angular-devkit/build-angular     0.901.8
@angular-devkit/build-optimizer   0.901.8
@angular-devkit/build-webpack     0.901.8
@angular-devkit/core              9.1.8
@angular-devkit/schematics        9.1.8
@angular/cli                      9.1.8
@ngtools/webpack                  9.1.8
@schematics/angular               9.1.8
@schematics/update                0.901.8
rxjs                              6.5.5
typescript                        3.8.3
webpack                           4.42.0

Scully Version:




0.0.102

🔥 Exception or Error




SanderElias commented 4 years ago

This depends on your use-case. With static site rendering, your site is rendered as any user that visits it for the first time would see it. If that includes a modal, that is what will get rendered. If your angular app decides on a cookie to remove the modal, that will only happen after your angular app is started. In cases like this, you might want to add a small amount of JS that handles this stuff outside of angular, and before its tarts.

moritz31 commented 4 years ago

I've found a way by just setting a user agent for puppeteer and then just filter the modal out if this user agents access the site

SanderElias commented 4 years ago

Closing as it seems solved, and we currently don't see anything actionable in here. If there is something we can do, we will reopen this.