mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 14:11:50 +03:00
aeeac55732
Splits CRPage into CRPage and FrameSession, carefully broadcasting or picking the right session for each operation.
20 lines
574 B
HTML
20 lines
574 B
HTML
<script>
|
|
function goLocal() {
|
|
document.querySelector('iframe').src = location.href.replace('dynamic-oopif.html', 'grid.html');
|
|
}
|
|
|
|
function goRemote(iframe) {
|
|
iframe = iframe || document.querySelector('iframe');
|
|
const url = new URL(location.href);
|
|
url.hostname = url.hostname === 'localhost' ? '127.0.0.1' : 'localhost';
|
|
url.pathname = '/grid.html';
|
|
iframe.src = url.toString();
|
|
}
|
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
const iframe = document.createElement('iframe');
|
|
goRemote(iframe);
|
|
document.body.appendChild(iframe);
|
|
}, false);
|
|
</script>
|