question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Record custom element extension version numbers in AMP4ADS response.

See original GitHub issue

Currently AMP4ADS documents have a JSON field that lists the set of custom element extensions in the document.

For example, if a document contains:

<script async custom-element='amp-analytics' src='https://cdn.ampproject.org/v0/amp-analytics-0.1.js'></script>
<script async custom-element='amp-list' src='https://cdn.ampproject.org/v0/amp-list-0.1.js'></script>

The AMP4ADS json will include:

"customElementExtensions" : [ "amp-analytics", "amp-list" ]

In the future, it will become important to also include the version numbers used in these extensions in some form. Currently they are (almost) all version 0.1 only.

My first suggestion is to actually capture the entire attribute values, rather than parse out the version.

"customElementExtensions" : [
   {
      "custom-element": "amp-analytics",
      "src": "https://cdn.ampproject.org/v0/amp-analytics-0.1.js"
   },
   {
      "custom-element": "amp-list",
      "src": "https://cdn.ampproject.org/v0/amp-list-0.1.js"
   },
]

This approach can also handle version labels such as amp-list-latest.js.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
Gregablecommented, Jan 26, 2017

Ideally you are already sending down:

"customElementExtensions" : [ "amp-analytics", "amp-list" ]

You should also now send down:

"customElements" : [
   {
      "custom-element": "amp-analytics",
      "src": "https://cdn.ampproject.org/v0/amp-analytics-0.1.js"
   },
   {
      "custom-element": "amp-list",
      "src": "https://cdn.ampproject.org/v0/amp-list-0.1.js"
   },
]

And at some point in the future, you can remove the former if you’d like.

0reactions
Gregablecommented, Jul 29, 2019

My understanding is that the client side implementation was here: https://github.com/ampproject/amphtml/pull/8381

And this has been implemented for a long time, but was never closed. Feel free to reopen if I am missing something.

Read more comments on GitHub >

github_iconTop Results From Across the Web

amphtml/amp-cache-modifications.md at main - GitHub
All modifications are made to both AMP and AMP4ADS documents except where ... Record UTF-16 offsets for AMP4ADS engine and custom-element extensions in ......
Read more >
Overview - Joe Sandbox
Uses secure TLS version for HTTPS connections ... f[2].txt0.2.dr, String found in binary or memory: https://cdn.ampproject.org/amp4ads-host-v0.js.
Read more >
Uncategorized - Accelerated Mobile Pages Project
Used in AMP's upcoming component model rework. ... $1,200, Document-register-element is the custom element we are using to drive AMP.
Read more >
Viewing online file analysis results for 'updater.exe'
Queries the display settings of system associated file extensions ... Get your own cloud service or the full version to view all details....
Read more >
Javascript validate alphanumeric and space
You can also define custom masking elements using the maskRules object. sk@micro. DIGITS — Value must be valid digits. Should be used after...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found