Files
cypress/packages/server/lib/util/inject.js
Brian Mann 2333d04a54 secure cookie error crash (#2685)
- fixes #1264 
- fixes #1321 
- fixes #1799  
- fixes #2689
- fixes #2688
- fixes #2687 	
- fixes #2686
2018-11-01 12:34:37 -04:00

28 lines
735 B
JavaScript

const { oneLine } = require('common-tags')
module.exports = {
partial (domain) {
return oneLine`
<script type='text/javascript'>
document.domain = '${domain}';
</script>
`
},
full (domain) {
return oneLine`
<script type='text/javascript'>
document.domain = '${domain}';
var 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!');
};
Cypress.action('app:window:before:load', window);
</script>
`
},
}