Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught Reference Error: stLight is not defined (in Chrome only)

My web page ends thus:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">var switchTo5x=false;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">
stLight.options({publisher: "ur-24e62f76-1f66-e3aa-1190-c533b729ca11", doNotHash: true, doNotCopy: true, hashAddressBar: false});
</script>
<script type="text/javascript" src="/static/bootstrap/js/bootstrap.js"></script>  
</body>
</html>

In FireFox and Safari, it behaves. In Chrome:

Uncaught ReferenceError: stLight is not defined nectar-tugg-art:229
(anonymous function)

In other words, the code at w.sharethis.com/button/buttons.js has failed to execute, and hence, failed to define the stLight variable.

The page is part of a Django web application running on a remote server. Saving the generated HTML page locally, then viewing in Chrome, works correctly.

At this point I'm stuck. Something to do with the cross domain security model? There aren't any security exceptions.

Some weird interaction with the other javascript files?

The static (generated) code is here. It won't run from Dropbox though.

like image 901
Steve Bennett Avatar asked Apr 22 '13 04:04

Steve Bennett


2 Answers

In my case I replaced

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>

this by

<script type="text/javascript" src="https://ws.sharethis.com/button/buttons.js"></script>

ShareThis

like image 116
Bimal Dev Avatar answered Oct 16 '22 18:10

Bimal Dev


Ok, think I may have found it: the site runs fine in Chrome's incognito (porn) mode. So I strongly suspect I've got some kind of extension that's interfering with it (like Do Not Track or something).

EDIT It's Collusion's "block known tracking sites" feature.

like image 33
Steve Bennett Avatar answered Oct 16 '22 18:10

Steve Bennett