Search code examples
javascriptinternet-explorerpinterest

Pinterest "Pin it" button breaking 'back' in Internet Explorer


I recently found out that in Internet Explorer (v9 at least), the "Pin it" button for Pinterest is breaking 'back' functionality in the browser. Right-clicking on it shows an entry like 'http://assets.pinterest.com/pidget.html' as the previous page.

Looks like Pinterest is adding an iFrame and IE is adding its address to the history. Clicking 'back' doesn't do anything. Is this a known issue and is there a fix for this?


Solution

  • well, as a temporary solution (other than removing the 'pin it' button), from reading their code, I believe (not tested) that you could add a part to the <script> call to disable logging, like this ...

    <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js" data-pin-do-not-log="true"></script>
    

    This works but doesn't apply for me because I load the script asynchronously and I use a load command, so what I did was I copied the pinit.js file locally to the server, and changed the part that says

    if(a.v.config["do-not-log"]||a.a.doNotLog===true)
    

    to

    if(a.v.config["do-not-log"]||a.a.doNotLog===true||true)
    

    looks like it's doing some sort of log in an iframe.