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

Implement embed-size-denied #1533

Closed
camelburrito opened this issue Jan 22, 2016 · 3 comments
Closed

Implement embed-size-denied #1533

camelburrito opened this issue Jan 22, 2016 · 3 comments
Assignees
Labels
INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code Type: Feature Request WG: monetization

Comments

@camelburrito
Copy link
Contributor

signal back ads/iframes when we couldn't expand on their embed-resize request. Send a postMessage with embed-size-denied (when the runtime can't resize)so that they can provide their own overflow element within and repeat request on tap. In that case AMP will definitely allow size change due to user action.

This would be useful for both: iframes and ads

CC @dvoytenko, @cramforce

@dvoytenko
Copy link
Contributor

We may also want to have the opposite message: embed-size-changed or such. This is because we automatically resize when an element gets focused.

@camelburrito
Copy link
Contributor Author

how about we give them a callback in this function
https://github.com/ampproject/amphtml/blob/master/3p/integration.js#L144

function triggerResizeRequest(width, height, callback) {
  nonSensitiveDataPostMessage('embed-size', {
    width: width,
    height: height,
  });
  // observe for embed-size-denied and embed-size-changed and 
  callback(status);
}

@dvoytenko
Copy link
Contributor

Here, it'd probably have to have two callbacks: one for success and one for denied. But I'm not sure it'd be actually convenient here. These kind of callbacks might be just easier to subscribe to once and keep the listener.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code Type: Feature Request WG: monetization
Projects
None yet
Development

No branches or pull requests

2 participants