Initial commit
This commit is contained in:
5
HTML/IframeCommunication/.idea/.gitignore
generated
vendored
Normal file
5
HTML/IframeCommunication/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
12
HTML/IframeCommunication/.idea/IframeCommunication.iml
generated
Normal file
12
HTML/IframeCommunication/.idea/IframeCommunication.iml
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
6
HTML/IframeCommunication/.idea/dictionaries
generated
Normal file
6
HTML/IframeCommunication/.idea/dictionaries
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="leon" />
|
||||
</component>
|
||||
</project>
|
||||
7
HTML/IframeCommunication/.idea/discord.xml
generated
Normal file
7
HTML/IframeCommunication/.idea/discord.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="PROJECT_FILES" />
|
||||
<option name="description" value="" />
|
||||
</component>
|
||||
</project>
|
||||
8
HTML/IframeCommunication/.idea/modules.xml
generated
Normal file
8
HTML/IframeCommunication/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/IframeCommunication.iml" filepath="$PROJECT_DIR$/.idea/IframeCommunication.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
HTML/IframeCommunication/.idea/vcs.xml
generated
Normal file
6
HTML/IframeCommunication/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
22
HTML/IframeCommunication/iframe.html
Normal file
22
HTML/IframeCommunication/iframe.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Inner IFrame</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Hello World</h1>
|
||||
<p></p>
|
||||
|
||||
<script>
|
||||
window.addEventListener('message', (event) => {
|
||||
const element = document.querySelector("p");
|
||||
element.innerText = JSON.stringify(event.data);
|
||||
}, false);
|
||||
|
||||
parent.postMessage("Fick die hänne", '*');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
41
HTML/IframeCommunication/index.html
Normal file
41
HTML/IframeCommunication/index.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Iframe Communication</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iframe name="frame" width="1000" height="1000"></iframe>
|
||||
|
||||
<script>
|
||||
window.open("iframe.html", "frame");
|
||||
|
||||
const windowProperties = {
|
||||
title: "Test Window",
|
||||
headerMessage: "Header Message",
|
||||
icon: "image.png",
|
||||
resizable: true,
|
||||
size: {width: 500, height: 600},
|
||||
minSize: {width: 500, height: 600},
|
||||
position: {x: 50, y: 200},
|
||||
htmlWindowRef: undefined,
|
||||
htmlContentRef: undefined,
|
||||
windowRef: undefined,
|
||||
headerActions: [],
|
||||
windowType: undefined,
|
||||
dialog: {open: false},
|
||||
};
|
||||
|
||||
window.onload = () => {
|
||||
const frame = document.querySelector("iframe");
|
||||
frame.contentWindow.postMessage(windowProperties, location.origin); // Iframe Origin
|
||||
};
|
||||
|
||||
window.addEventListener('message', (event) => {
|
||||
console.log(event);
|
||||
}, false);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user