Note: If the csp is specified, then the securityOrigin also has to be specified. Set the security origin, content security policy and name of the isolated world. name string (optional) - Name for isolated world.csp string (optional) - Content Security Policy for the isolated world.securityOrigin string (optional) - Security origin for the isolated world.Chrome extensions reserve the range of IDs in [1 << 20, 1 << 29). worldId Integer - The ID of the world to run the javascript in, 0 is the default world, 999 is the world used by Electrons contextIsolation feature.This is because Chromium does notĭispatch errors of isolated worlds to foreign worlds. Reject and the result would be undefined. Note that when the execution of script fails, the returned promise will not Works like executeJavaScript but evaluates scripts in an isolated context. Accepts valuesĬode or is rejected if execution could not start. World used by Electron's contextIsolation feature. In, 0 is the default main world (where content runs), 999 is the worldId Integer - The ID of the world to run the javascript.
webFrame.executeJavaScriptInIsolatedWorld(worldId, scripts) In the browser window some HTML APIs like requestFullScreen can only be Returns Promise - A promise that resolves with the result of the executedĬode or is rejected if execution throws or results in a rejected promise. ForĬompatibility with an older version of this method, the error parameter is Synchronous and the callback will be invoked before the method returns. showing a modal alert), execution will be
tVisualZoomLevelLimits(minimumLevel, maximumLevel) Differentiating the window URLs will make zoom work per-window.
Zoom level for a specific domain propagates across all instances of windows with NOTE: The zoom policy at the Chromium level is same-origin, meaning that the Limits of 300% and 50% of original size, respectively. Increment above or below represents zooming 20% larger or smaller to default tZoomLevel(level) Ĭhanges the zoom level to the specified level. Returns number - The current zoom factor. Zoom percent divided by 100, so 300% = 3.0. factor Double - Zoom factor default is 1.0.Ĭhanges the zoom factor to the specified factor.The WebFrame class has the following instance methods: tZoomFactor(factor)