Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Disqus is using <a href="https://www.google.com/search?q=javascript+postmessage" rel="nofollow noreferrer"><code>postMessage()</code></a> to send a message from the iframe back to the host page. If you look through the JavaScript code inside their main iframe and search for "postMessage" you'll find this code (original is minified, reformatted here):</p> <pre><code> DISQUS.define("Bus", function() { function e(a) { a = a.split("/"); return a[0] + "//" + a[2] } var g = DISQUS.use("JSON"), c = window.location.hash.slice(1), b = window.opener || window.parent, h = document.referrer, f = {}; f.client = e(document.location.href); f.host = h ? e(h) : f.client; return { origins: f, messageHandler: function(a) { var b; try { b = DISQUS.JSON.parse(a.data) } catch (c) { return } if (!(b.name[0] === "!" &amp;&amp; a.origin !== f.client)) switch (b.scope) { case "client": DISQUS.Bus.trigger(b.name, b.data) } }, postMessage: function(a) { a.sender = c; a = g.stringify(a); b.postMessage(a, "*") }, sendHostMessage: function(a, b) { b = b || []; DISQUS.Bus.postMessage({ scope: "host", name: a, data: b }) }, sendGlobalMessage: function(a, b) { b = b || []; DISQUS.Bus.postMessage({ scope: "global", name: a, data: b }) } } }); _.extend(DISQUS.Bus, Backbone.Events); $(document).ready(function() { var e = window.addEventListener ? window.addEventListener : window.attachEvent, g = window.addEventListener ? "message" : "onmessage"; if (!e) throw Error("No event support."); e(g, DISQUS.Bus.messageHandler, !1); window.onunload = function() { DISQUS.Bus.sendHostMessage("die") } </code></pre> <p>The use of <code>Bus</code> here makes sense: "In computer architecture, a bus is a subsystem that transfers data between components inside a computer, or between computers." (<a href="http://en.wikipedia.org/wiki/Bus_(computing)" rel="nofollow noreferrer">Wikipedia</a>)</p> <p>I would expect to see something loaded into the host page like the last part of that code that sets up the event listener, although I didn't find it in a cursory search through the scripts loaded into the host page.</p> <p>See also <a href="https://stackoverflow.com/questions/153152/resizing-an-iframe-based-on-content">Resizing an iframe based on content</a> for a related technique that works in older browsers.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload