-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swap cross-origin iframe to cross-origin request
I've picked the creative rotation example at random to try out the createWorklet function here. Unlike the previous commit where you can do a straight swap between addModule and createWorklet, in this commit I've removed the iframe completely. Whenever we request a worklet from a different origin we need to set the headers to allow cors and enable cross origin worklets. As I've removed the iframe, I've moved the contents to control the demo into the invoking page directly (using hbs partials). For the sake of the demo I've added the global getContentProducerUrl function to make it easier to check the domain of the content producer for getting the worklet and the ads. Also, as the demo is no longer being styled within the iframe I've copied the css styles to the publisher pages.
- Loading branch information
Showing
10 changed files
with
166 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div class="demo__controls-section"> | ||
<fencedframe id="ad-slot" mode="opaque-ads"></fencedframe> | ||
<div class="demo__controls"> | ||
<h5>Demo control</h5> | ||
<div class="demo__buttons-container"> | ||
<button | ||
class="mdl-button mdl-js-button mdl-button--raised demo__button" | ||
onclick="resetSharedStorage('sequential')" | ||
> | ||
Set rotation mode to <br />"Sequential" | ||
</button> | ||
<button | ||
class="mdl-button mdl-js-button mdl-button--raised demo__button" | ||
onclick="resetSharedStorage('even-distribution')" | ||
> | ||
Set rotation mode to <br />"Even distribution"<br />(~33% / ~33% / ~33%) | ||
</button> | ||
<button | ||
class="mdl-button mdl-js-button mdl-button--raised demo__button" | ||
onclick="resetSharedStorage('weighted-distribution')" | ||
> | ||
Set rotation mode to <br />"Weighted distribution"<br />(70% / 20% / 10%) | ||
</button> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 0 additions & 69 deletions
69
sites/content-producer/url-selection/creative-rotation.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters