mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
Issue #2197 - Part 2d: Implement PostMessageOptions for Window
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1502802
This commit is contained in:
parent
4d58139fe1
commit
4174037d8a
4 changed files with 23 additions and 7 deletions
|
|
@ -8904,6 +8904,17 @@ nsGlobalWindow::PostMessageMoz(JSContext* aCx,
|
|||
aSubjectPrincipal, aRv);
|
||||
}
|
||||
|
||||
void
|
||||
nsGlobalWindow::PostMessageMoz(JSContext* aCx,
|
||||
JS::Handle<JS::Value> aMessage,
|
||||
const WindowPostMessageOptions& aOptions,
|
||||
nsIPrincipal& aSubjectPrincipal,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
PostMessageMoz(aCx, aMessage, aOptions.mTargetOrigin, aOptions.mTransfer,
|
||||
aSubjectPrincipal, aRv);
|
||||
}
|
||||
|
||||
class nsCloseEvent : public Runnable {
|
||||
|
||||
RefPtr<nsGlobalWindow> mWindow;
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ class TabGroup;
|
|||
class Timeout;
|
||||
class U2F;
|
||||
class WakeLock;
|
||||
struct WindowPostMessageOptions;
|
||||
class Worklet;
|
||||
namespace cache {
|
||||
class CacheStorage;
|
||||
|
|
@ -936,6 +937,11 @@ public:
|
|||
const mozilla::dom::Sequence<JSObject*>& aTransfer,
|
||||
nsIPrincipal& aSubjectPrincipal,
|
||||
mozilla::ErrorResult& aRv);
|
||||
void PostMessageMoz(JSContext* aCx,
|
||||
JS::Handle<JS::Value> aMessage,
|
||||
const mozilla::dom::WindowPostMessageOptions& aOptions,
|
||||
nsIPrincipal& aSubjectPrincipal,
|
||||
mozilla::ErrorResult& aError);
|
||||
int32_t SetTimeout(JSContext* aCx, mozilla::dom::Function& aFunction,
|
||||
int32_t aTimeout,
|
||||
const mozilla::dom::Sequence<JS::Value>& aArguments,
|
||||
|
|
|
|||
|
|
@ -383,13 +383,6 @@ var tests =
|
|||
|
||||
hasWrongReturnOriginBug: true
|
||||
},
|
||||
// 55
|
||||
{
|
||||
args: ["NOT-RECEIVED", undefined],
|
||||
source: "sameDomain",
|
||||
name: "SyntaxError",
|
||||
code: DOMException.SYNTAX_ERR
|
||||
},
|
||||
];
|
||||
|
||||
function allTests(callback)
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ interface nsIDOMCrypto;
|
|||
|
||||
[Throws, CrossOriginCallable, NeedsSubjectPrincipal]
|
||||
void postMessage(any message, DOMString targetOrigin, optional sequence<object> transfer = []);
|
||||
[Throws, CrossOriginCallable, NeedsSubjectPrincipal]
|
||||
void postMessage(any message, optional WindowPostMessageOptions options);
|
||||
|
||||
// also has obsolete members
|
||||
};
|
||||
|
|
@ -485,3 +487,7 @@ callback IdleRequestCallback = void (IdleDeadline deadline);
|
|||
partial interface Window {
|
||||
[ChromeOnly] readonly attribute boolean isSecureContextIfOpenerIgnored;
|
||||
};
|
||||
|
||||
dictionary WindowPostMessageOptions : StructuredSerializeOptions {
|
||||
USVString targetOrigin = "/";
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue