* Installs a mutation observer in a window to look for iframes. * @param {!Window} win
(win)
| 146 | * @param {!Window} win |
| 147 | */ |
| 148 | function installObserver(win) { |
| 149 | if (!window.MutationObserver) { |
| 150 | return; |
| 151 | } |
| 152 | const observer = new MutationObserver(function (mutations) { |
| 153 | for (let i = 0; i < mutations.length; i++) { |
| 154 | maybeInstrumentsNodes(win, mutations[i].addedNodes); |
| 155 | } |
| 156 | }); |
| 157 | observer.observe(win.document.documentElement, { |
| 158 | subtree: true, |
| 159 | childList: true, |
| 160 | }); |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Replace timers with variants that can be throttled. |
no test coverage detected