7d2226e05e
Chromium already includes the necessary plumbing to manage the visibility properties and `visibilitychange` event so this gets rid of most of our custom logic for `BrowserWindow` and `BrowserView`. Note that `webview` remains unchanged and is still affected by the issues listed below. User facing changes: - The `document` visibility properties and `visibilitychange` event are now also updated/fired in response to occlusion changes on macOS. In other words, `document.visibilityState` will now be `hidden` on macOS if the window is occluded by another window. - Previously, `visibilitychange` was also fired by *both* Electron and Chromium in some cases (e.g. when hiding the window). Now it is only fired by Chromium so you no longer get duplicate events. - The visiblity state of `BrowserWindow`s created with `{ show: false }` is now initially `visible` until the window is shown and hidden. - The visibility state of `BrowserWindow`s with `backgroundThrottling` disabled is now permanently `visible`. This should also fix #6860 (but not for `webview`).
29 lines
774 B
HTML
29 lines
774 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Isolated World</title>
|
|
<script>
|
|
window.hello = 'world'
|
|
Array.prototype.push = 3
|
|
Function.prototype.apply = true
|
|
|
|
const opened = window.open()
|
|
opened.close()
|
|
|
|
window.postMessage({
|
|
preloadProperty: typeof window.foo,
|
|
pageProperty: typeof window.hello,
|
|
typeofRequire: typeof require,
|
|
typeofProcess: typeof process,
|
|
typeofArrayPush: typeof Array.prototype.push,
|
|
typeofFunctionApply: typeof Function.prototype.apply,
|
|
typeofPreloadExecuteJavaScriptProperty: typeof window.preloadExecuteJavaScriptProperty,
|
|
typeofOpenedWindow: typeof opened
|
|
}, '*')
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
</body>
|
|
</html>
|