diff --git a/.travis.yml b/.travis.yml index b5ef6c837b81..dbccee0bcfb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,7 @@ branches: - master - release - canary + - /^amp-release-.*$/ env: global: - NPM_CONFIG_PROGRESS="false" diff --git a/3p/environment.js b/3p/environment.js index b44d07cd4a4c..ca981321eb71 100644 --- a/3p/environment.js +++ b/3p/environment.js @@ -64,6 +64,7 @@ function manageWin_(win) { installObserver(win); // Existing iframes. maybeInstrumentsNodes(win, win.document.querySelectorAll('iframe')); + blockSyncPopups(win); } @@ -237,6 +238,33 @@ function instrumentEntryPoints(win) { } } +/** + * Blackhole the legacy popups since they should never be used for anything. + * @param {!Window} win + */ +function blockSyncPopups(win) { + let count = 0; + function maybeThrow() { + // Prevent deep recursion. + if (count++ > 2) { + throw new Error('security error'); + } + } + try { + win.alert = maybeThrow; + win.prompt = function() { + maybeThrow(); + return ''; + }; + win.confirm = function() { + maybeThrow(); + return false; + }; + } catch (e) { + console./*OK*/error(e.message, e.stack); + } +} + /** * Run when we just became visible again. Runs all the queued up rafs. * @visibleForTesting diff --git a/3p/integration.js b/3p/integration.js index 57c324c72634..0b9d6eb4d922 100644 --- a/3p/integration.js +++ b/3p/integration.js @@ -30,6 +30,7 @@ import {adreactor} from '../ads/adreactor'; import {adsense} from '../ads/adsense'; import {adtech} from '../ads/adtech'; import {plista} from '../ads/plista'; +import {criteo} from '../ads/criteo'; import {doubleclick} from '../ads/doubleclick'; import {dotandads} from '../ads/dotandads'; import {endsWith} from '../src/string'; @@ -47,6 +48,10 @@ import {taboola} from '../ads/taboola'; import {smartadserver} from '../ads/smartadserver'; import {revcontent} from '../ads/revcontent'; import {openadstream} from '../ads/openadstream'; +import {triplelift} from '../ads/triplelift'; +import {teads} from '../ads/teads'; +import {rubicon} from '../ads/rubicon'; +import {imobile} from '../ads/imobile'; /** * Whether the embed type may be used with amp-embed tag. @@ -62,6 +67,7 @@ register('adreactor', adreactor); register('adsense', adsense); register('adtech', adtech); register('plista', plista); +register('criteo', criteo); register('doubleclick', doubleclick); register('flite', flite); register('taboola', taboola); @@ -76,6 +82,10 @@ register('smartadserver', smartadserver); register('mediaimpact', mediaimpact); register('revcontent', revcontent); register('openadstream', openadstream); +register('triplelift', triplelift); +register('teads', teads); +register('rubicon', rubicon); +register('imobile', imobile); // For backward compat, we always allow these types without the iframe // opting in. diff --git a/3p/remote.html b/3p/remote.html index d59e8a1de444..c160c339f13f 100644 --- a/3p/remote.html +++ b/3p/remote.html @@ -16,7 +16,7 @@ - - - -
-