Skip to content

Commit

Permalink
use setZeroTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mykmelez committed Oct 15, 2014
1 parent 197e2ee commit e6c09d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<link rel="stylesheet" type="text/css" href="style/index.css">
<script type="text/javascript" src="libs/promise-6.0.0.js" defer></script>
<script type="text/javascript" src="libs/urlparams.js" defer></script>
<script type="text/javascript" src="timer.js" defer></script>
<script type="text/javascript" src="index.js" defer></script>
</head>

Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ var DumbPipe = {
this.outgoingMessages.push(envelope);

var mozbrowser = document.getElementById("mozbrowser");
window.setTimeout(function() {
window.setZeroTimeout(function() {
mozbrowser.src = mozbrowser.src.split("#")[0] + "#" + this.nextHashID++;
}.bind(this), 0);
}.bind(this));
},

receiveMessage: function(pipeID, message, detail) {
window.setTimeout(function() {
window.setZeroTimeout(function() {
if (!this.recipients[pipeID]) {
console.warn("nonexistent pipe " + pipeID + " received message " + JSON.stringify(message));
return;
Expand All @@ -129,7 +129,7 @@ var DumbPipe = {
} catch(ex) {
console.error(ex + "\n" + ex.stack);
}
}.bind(this), 0);
}.bind(this));
},

getMessages: function(event) {
Expand Down

0 comments on commit e6c09d3

Please sign in to comment.