Skip to content
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

Embed fallbacks #493

Closed
wants to merge 9 commits into from
Closed

Embed fallbacks #493

wants to merge 9 commits into from

Commits on Sep 27, 2016

  1. Sanitize audio/video: update source attributes

    Both the audio and video sanitizers use the same routine to iterate
    through the source elements within the main node and filter/sanitize
    their attributes. However, the filtered attributes are not added back to
    the source element before it is appended to the new amp-audio or
    amp-video element. This is problematic when the attribute filtering
    method converts URLs from http to https, but the converted URL does not
    make it back into the source element.
    
    This commit addresses the issue by updating each source element's
    attributes before it is appended.
    coreymckrill committed Sep 27, 2016
    Configuration menu
    Copy the full SHA
    2c11b6a View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2016

  1. Fallbacks: Replace invalid audio/video element with fallback element

    If an audio or video element, or its source child element, has a src
    URL, but it is invalid (eg it uses the http protocol instead of https),
    this creates a fallback blockquote element to replace the original that
    explains that the media could not be loaded.
    coreymckrill committed Sep 28, 2016
    Configuration menu
    Copy the full SHA
    696d1d0 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2016

  1. Configuration menu
    Copy the full SHA
    3832b59 View commit details
    Browse the repository at this point in the history
  2. Fallbacks: Replace invalid iframe element with fallback element

    Creates a fallback blockquote element to replace an iframe that doesn't
    have a valid src attribute.
    coreymckrill committed Sep 29, 2016
    Configuration menu
    Copy the full SHA
    9e02d56 View commit details
    Browse the repository at this point in the history
  3. Maybe set https scheme on URLs with relative protocols

    For a URL with a relative protocol, such as
    
    //www.youtube.com/watch?v=dQw4w9WgXcQ
    
    ...the assumption is that either http or https will work with it. Since
    AMP requires https, we should go ahead and add the https scheme to these
    during filtering, if the sanitizer is configured to require or force
    the protocol.
    coreymckrill committed Sep 29, 2016
    Configuration menu
    Copy the full SHA
    e5a6253 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a689a2c View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2016

  1. Configuration menu
    Copy the full SHA
    2365364 View commit details
    Browse the repository at this point in the history
  2. Fallbacks: update tests

    In the previous commit I removed the embed-specific class name from the
    abstracted `create_fallback_node` method, but forgot to update the tests
    coreymckrill committed Oct 6, 2016
    Configuration menu
    Copy the full SHA
    b1077d6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f7dafe5 View commit details
    Browse the repository at this point in the history