From ce77e3327ce4a418b5c7fe3482c160ba275a9524 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 22 May 2020 00:56:22 +0900 Subject: [PATCH] docs: errors in isolated world are not dispatched (#23653) --- docs/api/web-frame.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/api/web-frame.md b/docs/api/web-frame.md index 6d2e5b5fdf..9cfc4f2c3b 100644 --- a/docs/api/web-frame.md +++ b/docs/api/web-frame.md @@ -162,10 +162,14 @@ this limitation. * `error` Error Returns `Promise` - A promise that resolves with the result of the executed -code or is rejected if execution throws or results in a rejected promise. +code or is rejected if execution could not start. Works like `executeJavaScript` but evaluates `scripts` in an isolated context. +Note that when the execution of script fails, the returned promise will not +reject and the `result` would be `undefined`. This is because Chromium does not +dispatch errors of isolated worlds to foreign worlds. + ### `webFrame.setIsolatedWorldInfo(worldId, info)` * `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. Chrome extensions reserve the range of IDs in `[1 << 20, 1 << 29)`. You can provide any integer here. * `info` Object