Skip to content

Commit

Permalink
Merge pull request #98 from basil79/rollback-dfp-message
Browse files Browse the repository at this point in the history
rollback for dfp postMessage
  • Loading branch information
basil79 committed Feb 22, 2023
2 parents f416ad8 + aa92d81 commit ebca255
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/ads-manager.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ads-manager.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ads-manager",
"version": "1.2.9",
"version": "1.2.10",
"description": "HTML5 Video Ads Manager based on @dailymotion/vast-client",
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
6 changes: 3 additions & 3 deletions public/js/ads-manager.js

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions src/ads-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,13 +720,7 @@ AdsManager.prototype.loadCreativeAsset = function(fileURL) {
this._vpaidIframe.contentWindow.document.write(`
<script>function sendMessage(msg) {
var postMsg = 'adm:${this._requestId}://' + JSON.stringify(msg);
if(window.parent.length > 1) {
for (var i = 0; i < window.parent.length; i++) {
window.parent[i].postMessage(postMsg, '*');
}
} else {
window.parent.postMessage(postMsg, '*');
}
window.parent.postMessage(postMsg, '*');
} \x3c/script>
<script type="text/javascript" onload="sendMessage('load')" onerror="sendMessage('error')" src="${fileURL}"> \x3c/script>`);
this._vpaidIframe.contentWindow.document.close();
Expand Down

0 comments on commit ebca255

Please sign in to comment.