{"action":"created","issue":{"url":"https://api.github.com/repos/guardian/frontend/issues/15207","repository_url":"https://api.github.com/repos/guardian/frontend","labels_url":"https://api.github.com/repos/guardian/frontend/issues/15207/labels{/name}","comments_url":"https://api.github.com/repos/guardian/frontend/issues/15207/comments","events_url":"https://api.github.com/repos/guardian/frontend/issues/15207/events","html_url":"https://github.com/guardian/frontend/pull/15207","id":193284171,"number":15207,"title":"Messenger: unify resize slot handling","user":{"login":"regiskuckaertz","id":629976,"avatar_url":"https://avatars.githubusercontent.com/u/629976?v=3","gravatar_id":"","url":"https://api.github.com/users/regiskuckaertz","html_url":"https://github.com/regiskuckaertz","followers_url":"https://api.github.com/users/regiskuckaertz/followers","following_url":"https://api.github.com/users/regiskuckaertz/following{/other_user}","gists_url":"https://api.github.com/users/regiskuckaertz/gists{/gist_id}","starred_url":"https://api.github.com/users/regiskuckaertz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regiskuckaertz/subscriptions","organizations_url":"https://api.github.com/users/regiskuckaertz/orgs","repos_url":"https://api.github.com/users/regiskuckaertz/repos","events_url":"https://api.github.com/users/regiskuckaertz/events{/privacy}","received_events_url":"https://api.github.com/users/regiskuckaertz/received_events","type":"User","site_admin":false},"labels":[{"id":5275205,"url":"https://api.github.com/repos/guardian/frontend/labels/bug","name":"bug","color":"cc2b12","default":true},{"id":238286451,"url":"https://api.github.com/repos/guardian/frontend/labels/commercial","name":"commercial","color":"197caa","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/guardian/frontend/milestones/2","html_url":"https://github.com/guardian/frontend/milestones/Commercial%20Team%20Q3%202016","labels_url":"https://api.github.com/repos/guardian/frontend/milestones/2/labels","id":2043531,"number":2,"title":"Commercial Team Q3 2016","description":"","creator":{"login":"regiskuckaertz","id":629976,"avatar_url":"https://avatars.githubusercontent.com/u/629976?v=3","gravatar_id":"","url":"https://api.github.com/users/regiskuckaertz","html_url":"https://github.com/regiskuckaertz","followers_url":"https://api.github.com/users/regiskuckaertz/followers","following_url":"https://api.github.com/users/regiskuckaertz/following{/other_user}","gists_url":"https://api.github.com/users/regiskuckaertz/gists{/gist_id}","starred_url":"https://api.github.com/users/regiskuckaertz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regiskuckaertz/subscriptions","organizations_url":"https://api.github.com/users/regiskuckaertz/orgs","repos_url":"https://api.github.com/users/regiskuckaertz/repos","events_url":"https://api.github.com/users/regiskuckaertz/events{/privacy}","received_events_url":"https://api.github.com/users/regiskuckaertz/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":77,"state":"open","created_at":"2016-10-03T09:06:38Z","updated_at":"2016-12-03T12:28:00Z","due_on":"2016-12-30T00:00:00Z","closed_at":null},"comments":1,"created_at":"2016-12-03T12:28:00Z","updated_at":"2016-12-03T12:28:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/guardian/frontend/pulls/15207","html_url":"https://github.com/guardian/frontend/pull/15207","diff_url":"https://github.com/guardian/frontend/pull/15207.diff","patch_url":"https://github.com/guardian/frontend/pull/15207.patch"},"body":"Historically, we have introduced the ability to resize the top slot for Rubicon ads, in the particular case where even though DFP returned a 728x90 creative size, the Rubicon ad turned out to be 970x250. It was handled via a `window.postMessage` call that sends a message of type `set-ad-height`.\r\n\r\nLater on, native ads had a very similar use case. We introduced the more general [`resize`](https://github.com/guardian/frontend/blob/master/static/src/javascripts/projects/commercial/modules/messenger/resize.js) event into our cross-frame protocol. This event takes care of resizing the iframe and its slot container.\r\n\r\nRecently, AppNexus has had the very same need, although in the right-hand slot. We thus reused the `set-ad-height` message in yet another module, and it worked. But they have also asked for the same thing in the top slot. In theory, it should work, and indeed it does ... except that the `set-ad-height` does not resize the iframe (only the slot) and the AppNexus creative does not do it either. The result is we end up with a top slot that is the correct size, but the creative appears truncated.\r\n\r\nWell, I thought that was enough forking. First, it is not good to rely on the creative to resize the iframe. In a SafeFrame context, this must be done by the parent page. Second, there was too much duplication and message handling.\r\n\r\nIn this PR, we morph the `set-ad-height` message into a `resize` one. This greatly simplifies the logic and makes everything work exactly the same."},"comment":{"url":"https://api.github.com/repos/guardian/frontend/issues/comments/264636432","html_url":"https://github.com/guardian/frontend/pull/15207#issuecomment-264636432","issue_url":"https://api.github.com/repos/guardian/frontend/issues/15207","id":264636432,"user":{"login":"regiskuckaertz","id":629976,"avatar_url":"https://avatars.githubusercontent.com/u/629976?v=3","gravatar_id":"","url":"https://api.github.com/users/regiskuckaertz","html_url":"https://github.com/regiskuckaertz","followers_url":"https://api.github.com/users/regiskuckaertz/followers","following_url":"https://api.github.com/users/regiskuckaertz/following{/other_user}","gists_url":"https://api.github.com/users/regiskuckaertz/gists{/gist_id}","starred_url":"https://api.github.com/users/regiskuckaertz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regiskuckaertz/subscriptions","organizations_url":"https://api.github.com/users/regiskuckaertz/orgs","repos_url":"https://api.github.com/users/regiskuckaertz/repos","events_url":"https://api.github.com/users/regiskuckaertz/events{/privacy}","received_events_url":"https://api.github.com/users/regiskuckaertz/received_events","type":"User","site_admin":false},"created_at":"2016-12-03T12:28:13Z","updated_at":"2016-12-03T12:28:13Z","body":"![](https://github.trello.services/images/mini-trello-icon.png) [Allow AppNexus ads to resize the top banner](https://trello.com/c/27D66Af0/178-allow-appnexus-ads-to-resize-the-top-banner)"}}
{"actor":{"display_login":"regiskuckaertz"}}