DataTables / VisualEvent

Visually show Javascript events on a page
http://sprymedia.co.uk
1.04k stars 162 forks source link

Script won't load with HTTPS #60

Closed Artoria2e5 closed 8 years ago

Artoria2e5 commented 8 years ago

Both the bookmarklet and the script itself explicitly uses HTTP requests which is unnecessary.

From https://github.com/DataTables/VisualEvent/blob/1efae22ef2224449c3efb1ab2b156d9e3f284e02/bookmarklet.html#L68-L71:

    var protocol = window.location.protocol === 'file:' ?
        'http:' : '';
    var url = protocol+'//www.sprymedia.co.uk/VisualEvent/VisualEvent_Loader.js';
    //var url = protocol+'//localhost/VisualEvent/builds/VisualEvent_Loader.js';

This is unnecessary as using

<script src='//www.sprymedia.co.uk/VisualEvent/VisualEvent_Loader.js'/>

automatically requests the page using the current protocol -- file, http or https. The sprymedia site has HTTPS available, so this won't be a problem either.

Similar segment appears in the actual code around https://github.com/DataTables/VisualEvent/blob/1efae22ef2224449c3efb1ab2b156d9e3f284e02/js/VisualEvent_Loader.js#L83-L84.

DataTables commented 8 years ago

Good point - however for the loader I think the current behaviour is actually correct - since requesting file://www.sprymedia.co.uk/... is not going to do any good - will just give you a 404.

Artoria2e5 commented 8 years ago

Grr, It's my Privacy Badger plugin blocking it…