mixonic
mixonic

Reputation: 2703

How can I trigger AMP development mode without a URL

I'm building some tooling for the design of AMP pages. According to the docs, one should add #development=1 to the URL of a pages to trigger validations.

The tooling I've written generates an AMP HTML document and uses an iframe srcdoc attribute to render it on the fly. Thus there is no URL. Is there another way to trigger validations and development mode?

Upvotes: 1

Views: 1937

Answers (1)

mixonic
mixonic

Reputation: 2703

Per the comment at https://github.com/ampproject/amphtml/issues/999#issuecomment-171787638, the validator can be used programmatically. A demo: https://jsfiddle.net/4yoxog13/5/

I believe this validator is the official one, source code here.

Some code because stackoverflow wants there to be code.

Upvotes: 3

Related Questions