Merge pull request #2762 from jmoenig/missing-contentWindow-API-docs

Missing "contentWindow" in API documentation
pull/95/head
Jens Mönig 2021-01-07 13:12:01 +01:00 zatwierdzone przez GitHub
commit d4b749b906
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 2 usunięć

4
API.md
Wyświetl plik

@ -70,14 +70,14 @@ If the iframe and the container do not share domains, you won't be able to reach
and, thus, the API. For that particular case, you should use the `postMessage` mechanism,
as follows:
document.querySelector('iframe').postMessage(
document.querySelector('iframe').contentWindow.postMessage(
{ selector: <API selector>, params: <param array> },
'*'
);
For instance, to get the value of a variable named "foo", you would do:
document.querySelector('iframe').postMessage(
document.querySelector('iframe').contentWindow.postMessage(
{ selector: 'getVar', params: [ 'foo' ] },
'*'
);