I want the user to open a popup from the bookmarklet, but the page loads as a jquery modal, which means there are no ugly browser borders.
See an example here, how does Amazon do this?
http://www.amazon.co.uk/wishlist/get-button
In addition, they obviously clear the page to get information, but the page loading is almost instantaneous, do they cache every page that the user somehow reads? How else will they achieve this? I tried simple-html-dom, but this is far from instant
This is using Amazon JS:
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]&&d[r]!='complete'?T(g,200):!w[n]?(s[a]('charset','UTF-8'),s[a]('src',u+'.js?loc='+e(l)+'&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)+'&t='+e(d.title):g()}())
Decorated and manually deobfused:
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] && d[r] != 'complete') { T(g, 200); } else if(!w[n]) { s[a]('charset', 'UTF-8'); s[a]('src', u + '.js?loc=' + e(l) + '&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) + '&t=' + e(d.title); } else { g(); } }())