Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change url to relative scheme #84

Merged
merged 1 commit into from
Mar 21, 2014
Merged

Change url to relative scheme #84

merged 1 commit into from
Mar 21, 2014

Conversation

Jellyfrog
Copy link
Contributor

This fixes the problem with Chrome (and others?) can't run the script on HTTPS-sites. The certificate is not valid but it works anyway.

This fixes the problem with Chrome (and others?) can't run the script on HTTPS-sites. The certificate is not valid but it works anyway.
@@ -124,7 +124,7 @@ <h2 class="screen-hide">WCAG 2.0 Bookmarklet</h2>
</script>

<div class="button" onclick="alert('Drag this to your browser Bookmarks Bar to install. Once installed, you can run the WCAG Bookmarklet over any page.'); return false;">
<a id="add-bookmarklet" onmousedown="_gaq.push(['_trackEvent', 'Viper', 'bookmarklet.clicked']);" href="javascript:(function() {var _p='http://squizlabs.github.io/HTML_CodeSniffer/build/';var _i=function(s,cb) {var sc=document.createElement('script');sc.onload = function() {sc.onload = null;sc.onreadystatechange = null;cb.call(this);};sc.onreadystatechange = function(){if(/^(complete|loaded)$/.test(this.readyState) === true){sc.onreadystatechange = null;sc.onload();}};sc.src=s;if (document.head) {document.head.appendChild(sc);} else {document.getElementsByTagName('head')[0].appendChild(sc);}}; var options={path:_p};_i(_p+'HTMLCS.js',function(){HTMLCSAuditor.run('WCAG2AA',null,options);});})();"><span class="screen-hide">HTML_CodeSniffer</span></a>
<a id="add-bookmarklet" onmousedown="_gaq.push(['_trackEvent', 'Viper', 'bookmarklet.clicked']);" href="javascript:(function() {var _p='//squizlabs.github.io/HTML_CodeSniffer/build/';var _i=function(s,cb) {var sc=document.createElement('script');sc.onload = function() {sc.onload = null;sc.onreadystatechange = null;cb.call(this);};sc.onreadystatechange = function(){if(/^(complete|loaded)$/.test(this.readyState) === true){sc.onreadystatechange = null;sc.onload();}};sc.src=s;if (document.head) {document.head.appendChild(sc);} else {document.getElementsByTagName('head')[0].appendChild(sc);}}; var options={path:_p};_i(_p+'HTMLCS.js',function(){HTMLCSAuditor.run('WCAG2AA',null,options);});})();"><span class="screen-hide">HTML_CodeSniffer</span></a>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.io doesn't support HTTPS 😦

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does; https://squizlabs.github.io/HTML_CodeSniffer/build/HTMLCS.js
Invalid cert but chrome wont complain when loading the bookmark.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine, invalid cert tho, but chrome doesn't care about that.

On 8 nov 2013, at 16:19, Nick Schonning notifications@github.com wrote:

In index.html:

@@ -124,7 +124,7 @@

WCAG 2.0 Bookmarklet


</script>

                 <div class="button" onclick="alert('Drag this to your browser Bookmarks Bar to install.  Once installed, you can run the WCAG Bookmarklet over any page.'); return false;">
  •                    <a id="add-bookmarklet" onmousedown="_gaq.push(['_trackEvent', 'Viper', 'bookmarklet.clicked']);" href="javascript:(function() {var _p='http://squizlabs.github.io/HTML_CodeSniffer/build/';var _i=function(s,cb) {var sc=document.createElement('script');sc.onload = function() {sc.onload = null;sc.onreadystatechange = null;cb.call(this);};sc.onreadystatechange = function(){if(/^(complete|loaded)$/.test(this.readyState) === true){sc.onreadystatechange = null;sc.onload();}};sc.src=s;if (document.head) {document.head.appendChild(sc);} else {document.getElementsByTagName('head')[0].appendChild(sc);}}; var options={path:_p};_i(_p+'HTMLCS.js',function(){HTMLCSAuditor.run('WCAG2AA',null,options);});})();"><span class="screen-hide">HTML_CodeSniffer</span></a>
    
  •                    <a id="add-bookmarklet" onmousedown="_gaq.push(['_trackEvent', 'Viper', 'bookmarklet.clicked']);" href="javascript:(function() {var _p='//squizlabs.github.io/HTML_CodeSniffer/build/';var _i=function(s,cb) {var sc=document.createElement('script');sc.onload = function() {sc.onload = null;sc.onreadystatechange = null;cb.call(this);};sc.onreadystatechange = function(){if(/^(complete|loaded)$/.test(this.readyState) === true){sc.onreadystatechange = null;sc.onload();}};sc.src=s;if (document.head) {document.head.appendChild(sc);} else {document.getElementsByTagName('head')[0].appendChild(sc);}}; var options={path:_p};_i(_p+'HTMLCS.js',function(){HTMLCSAuditor.run('WCAG2AA',null,options);});})();"><span class="screen-hide">HTML_CodeSniffer</span></a>
    
    github.io doesn't support HTTPS


Reply to this email directly or view it on GitHub.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can force the browser to ignore the cert error manually, but id doesn't work loading as a resource. Try the following

<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta charset="utf-8">
  <title>HTTPS Test</title>
  <script src="https://squizlabs.github.io/HTML_CodeSniffer/build/HTMLCS.js"></script>
</head>
<body>
Test HTTPS
</body>
</html>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn you're right guys, I've must have accepted the certificate in the same browser session, that way it works.

Ive also contacted github support had they said they have no plans to support https, too bad since they only had to buy a valid cert.

@luketw
Copy link
Member

luketw commented Mar 21, 2014

Although GitHub Pages does not officially support HTTPS, the certificate they are now using includes *.github.io in the domains the certificate supports.
Their certificate was updated on 25-Feb-2014 and previously it might've only supported github.com - thus the cert error. Now this works on both Firefox and Chrome, even though the cert details provided by the former initially confused me.

So, going to merge this in. Thanks for the report and pull request!

luketw pushed a commit that referenced this pull request Mar 21, 2014
Change url to relative scheme, now GitHub's SSL cert supports github.io
@luketw luketw merged commit 736155a into squizlabs:gh-pages Mar 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants