qrcodejs icon indicating copy to clipboard operation
qrcodejs copied to clipboard

Demo page at https://davidshimjs.github.io/qrcodejs/ doesn't work when on HTTPS

Open rodikh opened this issue 9 years ago • 5 comments

I found this library through google, and was directed to https://davidshimjs.github.io/qrcodejs/ (https). I scrolled down to the demo and the qr image didn't show up in the codepen widget.

An error was thrown to the console:

Mixed Content: The page at 'https://s.codepen.io/davidshimjs/fullembedgrid/rJgjv?type=embed&animations=run' was loaded over HTTPS, but requested an insecure script 'http://davidshimjs.github.com/qrcodejs/qrcode.min.js'. This request has been blocked; the content must be served over HTTPS.

pen.js:2 Uncaught ReferenceError: QRCode is not defined(anonymous function) @ pen.js:2

The issue was fixed when I rewrote the url to http.

rodikh avatar Jan 27 '16 08:01 rodikh

+1 Thanks for posting this and saving me headache

hahnicity avatar Apr 20 '16 05:04 hahnicity

Firstly, great work on qrcodejs!

To chip in with this issue, it looks like the external library on the following page (http://codepen.io/davidshimjs/pen/rJgjv) is linking to the http resource.

Have you tried changing: http://davidshimjs.github.com/qrcodejs/qrcode.min.js to this: //davidshimjs.github.com/qrcodejs/qrcode.min.js

Thanks.

cwild avatar Jun 01 '16 17:06 cwild

Just experienced this. It's not an important bug, any seasoned developer will open the console and understand the problem, but having a working project page is nice.

image

slezica avatar Sep 29 '16 20:09 slezica

I have a slightly different issue.

image

Entering

new QRCode(document.getElementById("qrcode"), "http://jindo.dev.naver.com/collie");

I get that QRCode is undefined, however I've included the script:

<script src="https://raw.githubusercontent.com/davidshimjs/qrcodejs/master/qrcode.min.js"></script>

before I do anything else, and I have a div with id qrcode like so: <div id="qrcode"></div>

Link to referenced script

justingolden21 avatar Mar 09 '20 23:03 justingolden21

I fixed it by replacing the top src with the bottom one:

<script src="https://raw.githubusercontent.com/davidshimjs/qrcodejs/master/qrcode.min.js"></script>
<script src="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js"></script>

As found on the Codepen here: https://davidshimjs.github.io/qrcodejs/

justingolden21 avatar Mar 09 '20 23:03 justingolden21