-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Inject into hard-coded secondary domain (#16873)
- Loading branch information
1 parent
69deb3e
commit b8658cf
Showing
15 changed files
with
126 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
File renamed without changes.
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,40 @@ | ||
/** | ||
* This is the entry point for the script that gets injected into | ||
* the AUT on a secondary domain. It gets bundled on its own and injected | ||
* into the <head> of the AUT by `packages/proxy`. | ||
* | ||
* If adding to this bundle, try to keep it light and free of | ||
* dependencies. | ||
*/ | ||
|
||
// TODO: uncomment the following code once the timing is worked out to have | ||
// the sibling Cypress global available before this injection code runs | ||
|
||
// import { createTimers } from './timers' | ||
|
||
// const Cypress = window.Cypress = parent.Cypress | ||
|
||
// if (!Cypress) { | ||
// throw new Error('Something went terribly wrong and we cannot proceed. We expected to find the global Cypress in the parent window but it is missing!. This should never happen and likely is a bug. Please open an issue!') | ||
// } | ||
|
||
// // We wrap timers in the injection code because if we do it in the driver (like | ||
// // we used to do), any uncaught errors thrown in the timer callbacks would | ||
// // get picked up by the top frame's 'error' handler instead of the AUT's. | ||
// // We need to wrap the timer callbacks in the AUT itself for errors to | ||
// // propagate properly. | ||
// const timers = createTimers() | ||
|
||
// Cypress.removeAllListeners('app:timers:reset') | ||
// Cypress.removeAllListeners('app:timers:pause') | ||
|
||
// Cypress.on('app:timers:reset', timers.reset) | ||
// Cypress.on('app:timers:pause', timers.pause) | ||
|
||
// timers.wrap() | ||
|
||
// TODO: change this to be window:before:load once coordination with | ||
// driver is fleshed out better | ||
window.addEventListener('load', () => { | ||
window.top.postMessage('app:cross:domain:window:load', '*') | ||
}) |
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