(win, type)
| 13 | * @return {!Window} |
| 14 | */ |
| 15 | export function masterSelection(win, type) { |
| 16 | type = type.toLowerCase(); |
| 17 | // The master has a special name. |
| 18 | const masterName = 'frame_' + type + '_master'; |
| 19 | let master; |
| 20 | try { |
| 21 | // Try to get the master from the parent. If it does not |
| 22 | // exist yet we get a security exception that we catch |
| 23 | // and ignore. |
| 24 | master = win.parent.frames[masterName]; |
| 25 | } catch (expected) { |
| 26 | /* ignore */ |
| 27 | } |
| 28 | if (!master) { |
| 29 | // No master yet, rename ourselves to be master. Yaihh. |
| 30 | win.name = masterName; |
| 31 | master = win; |
| 32 | } |
| 33 | return master; |
| 34 | } |
| 35 | |
| 36 | export class IntegrationAmpContext extends AbstractAmpContext { |
| 37 | /** @override */ |
no outgoing calls
no test coverage detected