Can I 'enable' js if I embed the 'real

2019-08-09 11:08发布

问题:

I'm trying to enable AMP (Accelerated Mobile Pages) on a JavaScript dependent page but AMP disallows js. Has anyone had any luck embedding pages with js in amp-iframes? And is this hacky enough that it might have negative SEO implications, perhaps, I'm afraid, quietly in the future? Or is it a super clever (and safe) thing that nobody does for some weird reason? I suspect it is a futile exercise but for the sake of the SEO I am tempted.

What I've learnt so far is that the amp-iframe source (at least) needs to be ssl enabled and it should not be same origin. So one would just need to put it somewhere else. I get that they may not want people doing this but I find it annoying cause my js is finally starting to be well behaved and I think it's unfair that a fast page can't get amp-related SEO points for being fast. Perhaps I'm missing something?

https://www.ampproject.org/docs/guides/amp_replacements.html