[meta] Implement `scripting.executeScript()`
Categories
(WebExtensions :: General, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: willdurand, Assigned: willdurand)
References
(Depends on 7 open bugs, Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, meta)
Attachments
(1 obsolete file)
Bug 1687764 is about implementing the entire MV3 API. Let's start small and focus on executScript()
only with this bug: https://developer.chrome.com/docs/extensions/reference/scripting/#method-executeScript
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
One thing to maybe consider in the future, making target
optional and defaulting to the active tab: https://bugs.chromium.org/p/chromium/issues/detail?id=1194519&q=component%3APlatform%3EExtensions%3EAPI
Comment 3•3 years ago
•
|
||
FYI relevant design docs from Chrome's side:
- https://bugs.chromium.org/p/chromium/issues/detail?id=1144839
- https://docs.google.com/document/d/1l75bKG3ecO7xJPzlnpaXQUhEy9wR1XcC2srwyB6E-aE/edit
- https://docs.google.com/document/d/1C68-UiKmG7TUN5xVpdw7eSiHRTQEjlGB2-svenaIm4s/edit
It seems that the documents are not accounting for non-serializable or non-callable functions. E.g.:
class X{}
= cannot be called, only withnew
.Math.min
=function() { [native functon] }
cannot be serialized.new Proxy(function() {}, {});
= Proxy around function.a = {async prop(){}, prop2() {}};
->a.prop
anda.prop2
cannot be called after trivial serialization ((async prop(){})()
and(prop2(){})()
are syntactically invalid)
The docs do account for cases where func.toString
has been overridden with a custom implementation.
In practice, Xray vision in Firefox ensures that func.toString
uses the native toString
implementation, but it would be good to have unit tests nevertheless. Consider making that part of the initial patch, or a follow-up bug.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Comment 4•3 years ago
|
||
Comment on attachment 9245672 [details]
Bug 1735474 - Implement browser.scripting.executeScript()
. r=robwu
Revision D128339 was moved to bug 1740601. Setting attachment 9245672 [details] to obsolete.
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 5•3 years ago
|
||
For scripting.executeScript()
, we currently have a limitation around the world
parameter. It only supports "ISOLATED"
, which is the default (see Bug 1759932). Adding support for other execution worlds is tracked in Bug 1736575.
Updated•1 year ago
|
(In reply to William Durand [:willdurand] from comment #5)
For
scripting.executeScript()
, we currently have a limitation around theworld
parameter. It only supports"ISOLATED"
, which is the default (see Bug 1759932). Adding support for other execution worlds is tracked in Bug 1736575.
Updating to dev-doc-complete as we now support "ISOLATED"
(102) and the "MAIN"
(128) and it's documented as such on MDN (in the BCD).
Description
•