Failed to execute ‘postMessage’ on ‘DOMWindow’: The Target Origin Provided (‘https://xxx.cn’) Does not match The Window’s Origin (‘null’).
Using the event. The source </ code> object as a letter
specific see: https://developer.mozilla.org...
// This function is called by addEventListenner when the A page postMessage is called.
function receiveMessage(event)
{
// Can we trust the source of the information?
if (event.origin ! == "http://example.com:8080")
return;
// event.source on the source page of the current popup page.
// event.data is "hello there!"
// Assuming you've already verified the origin of the received message (which you should do any time), a handy way to do this is to add the enent.source
// as the object of the reply, and use event.origin as the targetOrigin.
event.source.postMessage("hi there yourself! the secret response " +
"is: rheeeeet!",
event.origin);
}
window.addEventListener("message", receiveMessage, false);
The answer is helpful, it’s valuable 0 it’s not helpful, it’s the wrong answer, irrelevant answer
otherWindow.postMessage(message, targetOrigin, [transfer]);
otherWindow: a reference to another window, such as the contentWindow property of the iframe, the window object that executes window.open, or the named or numerically indexed window.frames.
otherWindow cannot be the current window oh
see MDN
Read More:
- Wrong classification of Python — assertion cur_ Target is greater than or equal to 0 and cur_ Target is less than n_ classes failed
- Failed to restart xxx.service: The name org.freedesktop.PolicyKit1 was not provided by any..
- Error: pathspec ‘origin / xxx’ did not match any file (s) known to GIT
- As Error:Failed to find configured root that contains /storage/emulated/0/xxx/xxx/xxx.png
- fatal: unable to access ‘https://github.com/xxx‘: Failed to connect to github.com
- Git failed to submit data error: failed to push some refs to’https://github.com/XXXXXXX/gif.git’
- Failed to load bundle…Unable to resolve module `xxx` from xxx: Module `xx` does not exist
- [Git & GitHub] Solution: error: failed to push some refs to’https://github.com/xxxx.git’
- remote: XXX Incorrect username or password (access token) fatal: Authentication failed for XXX
- Failed to execute goal on project XXXX-api: Could not resolve dependencies for pro
- Python learning notes (5) — cross entropy error runtimeerror: 1D target tensor expected, multi target not supported
- [solved] sql30082n security processing failed with reason “24” (“user name and / or password invalid”)
- Push failed Unable to access ‘https://github.com/‘: Failed to connect to github.com port 443: Timed
- Failed to execute ‘getComputedStyle’ on ‘Window’: parameter 1 is not of type ‘Element’.
- Failed to execute goal
- Springbatch failed to execute commandlinerunner
- The problem encountered in pyinstaller packaging “failed to execute script × *”
- Solve the error in Ubuntu 18.04: called “net usershare info” but it failed: failed to execute child process “net”
- Failed to find target with hash string ‘android-25’ in:D:\SDK