-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
amp-script overzealously terminates workers #26960
Comments
Oh, that's an interesting case. Have you tried this with an with layout != 'container' and with height and width set? |
Thanks for finding this! Definitely a bug. Seems like the
We'll need to either count dom @morsssss, this issue (and all terminations) only affect |
I have an issue like @mdmower sample!
A sample of this error was available at https://behnazar.com/%DA%A9%D8%B1%D9%85-%D9%88%DB%8C%D8%AA%D8%A7%D9%85%DB%8C%D9%86-%D8%B3%DB%8C/?amp=b1 Here is the JS script I wrote:
What's is a problem? and how I can fix that? |
The following snippet is at issue. navElements.forEach(function(element){
element.getElementsByClassName("off-wrp")[0].classList.remove("hidden");
}); To modify the classList of these elements, you'll need the user to perform an interaction, then change the values in response to the interaction. |
@kristoferbaxter Thanks bro |
@armanfeyzi: the only way to let Most publishers have been able to accomplish much of their ajax needs via amp-list though. |
What's the issue?
If an amp-script contains actions that require a user gesture to complete, and too long of a delay occurs between user gestures, the worker is terminated.
How do we reproduce the issue?
A minimal example is available at ampdemo.cmphys.com/worker-death/amp-script-worker-death.html.
Console errors report the worker has been terminated:
What browsers are affected?
Tested on Chrome 80:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36
Which AMP version is affected?
2002200031230
The text was updated successfully, but these errors were encountered: