使用Chrome访问github,无法加载css和js。但IE是OK的 [英] Use Chrome to visit github, can not load css and js. but IE is OK

查看:543
本文介绍了使用Chrome访问github,无法加载css和js。但IE是OK的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Chrome版本:50.0.2661.75 m
访问GitHub,无法加载css和javascript
错误:

 来源为https://assets-cdn.github.com的CSS样式表已被跨源资源共享策略阻止加载:没有访问控制允许原始标头存在于请求的资源。原因'https://github.com'因此不被允许访问。 
github.com/:1源自https://assets-cdn.github.com的脚本已被跨源资源共享策略阻止加载:否访问控制允许原始标头存在于所请求的资源上。原因'https://github.com'因此不被允许访问。
github.com/:1源自https://assets-cdn.github.com的CSS样式表已被跨源资源共享策略阻止加载:无访问控制允许原始报头存在于所请求的资源上。原因'https://github.com'因此不被允许访问。
github.com/:1源自https://assets-cdn.github.com的脚本已被跨源资源共享策略阻止加载:否访问控制允许原始标头存在于所请求的资源上。原因'https://github.com'因此不被允许访问。

我测试IE 11和旧版本chrome(49.0.2623.112 m) p>

解决方案

我知道这发生在我身上,所以我创建了一个Chrome扩展来解决这个问题。安装说明如下。


如何安装扩充功能



1 。 免费下载
2。按链接以下载crx文件
3。在网址框中输入 chrome:// extensions ,然后点击输入
4。打开.crx文件保存的位置
5。拖动&将.crx文件拖放到 chrome:// extensions 网站
6。当您在网站中悬停.crx文件时,它会显示将文件拖放到此处以安装
7。一旦删除.crx文件,它将显示添加扩展名&&  取消
8。按添加附加信息
9。您的完成
10。现在只要goto Github ,它应该与所有的CSS / JS加载。

想要请求网站为我修复电子邮件我 此处 ,我将在扩展程序上添加对该网站的支持。

CSS / JS不加载是因为我很确定google是试图停止跨源加载他们说这是出于安全原因。我不知道,但是我创建的扩展将修复在github ... 扩展最近已经使得我仍然试图修复一些错误







更新:
Ok我只是更新了扩展程序现在修复了错误它工作完美我添加了一个自动更新功能,所以当我更新它会自动检测和更新到最新版本。如果您可以下载新版本这里,您只需下载并安装此扩展程序之后,如果您要手动更新,则会自动更新到最新版本


如何手动更新延伸



1。转到 chrome:// extensions
2。查看页面的右上角
3。选中说明开发人员模式的框。
4。点击立即更新扩展按钮位于正在显示开发者模式的复选框
5。扩展程序现已更新。
启用开发人员模式复选框不会损害只适用于扩展程序/应用程序开发人员的任何内容







如果你不想启用开发人员模式,你不必要,但它将需要几个小时来检测更新的版本



h2>它现在正常工作

my chrome version:50.0.2661.75 m visit GitHub, can not load css and javascript error:

CSS stylesheet from origin 'https://assets-cdn.github.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://github.com' is therefore not allowed access.
github.com/:1 Script from origin 'https://assets-cdn.github.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://github.com' is therefore not allowed access.
github.com/:1 CSS stylesheet from origin 'https://assets-cdn.github.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://github.com' is therefore not allowed access.
github.com/:1 Script from origin 'https://assets-cdn.github.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://github.com' is therefore not allowed access.

I test IE 11 and old version chrome(49.0.2623.112 m), it is ok.

解决方案

I know this happened to me to so I created a Chrome Extension to fix that. Instructions to install it are below.

How To Install The Extension

1. Download This Free
2. Press the link to download the crx file
3. Type chrome://extensions in the URL box and hit Enter
4. Open the location where the .crx file saved
5. Drag & Drop the .crx file into the chrome://extensions website
6. While you are hovering the .crx file in the website it will show Drop file here to install
7. Once you drop the .crx file it will show Add extension & Cancel
8. Press Add extension
9. Your Done
10. Now just goto Github and it should work with all the CSS/JS loaded.

Want to request a website for me to fix email me here and I will add support for that website on the Extension.

The CSS/JS not loading is because I'm pretty sure that google is trying to stop Cross-Origin loading they said it was for security reasons. I'm not sure though but the extension I created will fix that on github... The extension has recently been made so im still trying to fix some of the bugs


Update: Ok I just updated the extension I fixed the bugs now and it works perfectly I added a Automatic Update feature so when I update it it will automatically detect and update to the latest version. If it you can download the new version Here you only need to download and install this extension once after that it will automatically update to the latest version if you want to manually update follow the instructions below

How To Manually Update The Extension

1. Goto chrome://extensions
2. Look on the Top Right of the page
3. Check the box that says Developer Mode
4. Click Update Extensions now the button is located right under the checkbox that says Developer Mode
5. The extension is now updated.
Enabling the Developer Mode Checkbox won't harm anything it just used for mostly extension/app developers


If you don't want to enable the developer mode you don't have to but it will take a few hours for it to detect the updated version of the extension.

Sorry Im trying to fix the extension again it stopped working

It is working for good now

这篇关于使用Chrome访问github,无法加载css和js。但IE是OK的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆