Remove the script tags from the
head and add the following coffeescript to your application:
$ -> ShareThisTurbolinks.reload() # if you're using jquery.turbolinks, you don't need this binding $(document).on 'page:load', -> ShareThisTurbolinks.reload() $(document).on 'page:restore', -> ShareThisTurbolinks.restore() ShareThisTurbolinks = load: -> window.switchTo5x = false $.getScript 'https://ws.sharethis.com/button/buttons.js', -> window.stLight.options publisher: 'your-publisher-id' reload: -> stlib?.cookie.deleteAllSTCookie() $('[src*="sharethis.com"], [href*="sharethis.com"]').remove() window.stLight = undefined @load() restore: -> $('.stwrapper, #stOverlay').remove() @reload()
This is known to work with the example shown in the official implementation above. If you use a more advanced implementation of ShareThis, and you find this solution isn't working, let me know.
Related Issues: #4
Credit: Nick Reed
All solutions should be considered unofficial. There is no guarantee that a given solution will work with your application. If you find that a solution is insufficient, please let me know by submitting an issue on Github.