Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do they do this? Modal bookmarklet and instant scraping?
    text
    copied!<p>I want a user to open a pop up window from a bookmarklet, but the page loads in like a jquery modal - meaning no ugly browser borders.</p> <p>See example here, how are Amazon doing this?</p> <p><a href="http://www.amazon.co.uk/wishlist/get-button" rel="nofollow">http://www.amazon.co.uk/wishlist/get-button</a></p> <p>Also, they are obviously scraping the page to get the info but the page load is almost instant, are they caching every page a user reads somehow? How else would they achieve this? I've tried simple-html-dom but it is far from instant</p> <p>This is the JS Amazon use:</p> <pre><code>javascript:(function(){var w=window,l=w.location,d=w.document,s=d.createElement('script'),e=encodeURIComponent,o='object',n='AUWLBookenGB',u='https://www.amazon.co.uk/wishlist/add',r='readyState',T=setTimeout,a='setAttribute',g=function(){d[r]&amp;&amp;d[r]!='complete'?T(g,200):!w[n]?(s[a]('charset','UTF-8'),s[a]('src',u+'.js?loc='+e(l)+'&amp;b='+n),d.body.appendChild(s),f()):f()},f=function(){!w[n]?T(f,200):w[n].showPopover()};typeof s!=o?l.href=u+'?u='+e(l)+'&amp;t='+e(d.title):g()}()) </code></pre> <p><a href="http://jsbeautifier.org" rel="nofollow">Beautified</a> and manually deobfuscated:</p> <pre><code>javascript:(function() { var w = window, l = w.location, d = w.document, s = d.createElement('script'), e = encodeURIComponent, o = 'object', n = 'AUWLBookenGB', u = 'https://www.amazon.co.uk/wishlist/add', r = 'readyState', T = setTimeout, a = 'setAttribute', g = function() { if (d[r] &amp;&amp; d[r] != 'complete') { T(g, 200); } else if(!w[n]) { s[a]('charset', 'UTF-8'); s[a]('src', u + '.js?loc=' + e(l) + '&amp;b=' + n); d.body.appendChild(s); f(); } else { f(); } }, f = function() { if (!w[n]) { T(f, 200); } else { w[n].showPopover(); } }; if (typeof s != o) { l.href = u + '?u=' + e(l) + '&amp;t=' + e(d.title); } else { g(); } }()) </code></pre>
 

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