Skip to content

Instantly share code, notes, and snippets.

@Pyrolistical
Created August 8, 2017 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pyrolistical/d07ece34a9956398b2ca75e9e4c985a0 to your computer and use it in GitHub Desktop.
Save Pyrolistical/d07ece34a9956398b2ca75e9e4c985a0 to your computer and use it in GitHub Desktop.
Repo case for firebase iframe sandbox issue
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>I r child</title>
<style>
body {
margin: 0;
padding: 0;
}
* {
box-sizing: border-box;
}
</style>
</head>
<body>
<p>Hi</p>
<div id="content"></div>
<script src="https://www.gstatic.com/firebasejs/4.2.0/firebase.js"></script>
<script>
var config = {
YOUR CONFIG
};
// this is workaround
// firebase.database.INTERNAL.forceWebSockets()
firebase.initializeApp(config);
firebase.database().ref('some-ref').once('value', function(dataSnapshot) {
console.log(dataSnapshot.val())
})
</script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>I haz iframe</title>
<style>
body {
margin: 0;
padding: 0;
}
* {
box-sizing: border-box;
}
</style>
</head>
<body>
<iframe id="viewer-overlay" src="http://localhost:8080/child.html" style="height: 720px; width: 1280px;" sandbox="allow-forms allow-scripts"></iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment