Why can't I @import from Chrome's userstylesheet Custom.css?

本秂侑毒 提交于 2019-12-12 05:26:44

问题


I was hoping to import other css files from withing the Chrome's custom stylesheet C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\Custom.css but it doesn't seem to be working. I have a stylish.1misc.css and a stylish.2img.css inside the same dir as above. Also with symlinks I've set them up on my localserver as http://localhost/.my/stylish.2img.css but none of the @import rules seem to be working

@import "stylish.1misc.css";
@import url("stylish.1misc.css");
@import url("http://localhost/.my/stylish.2img.css");
@import url("file:///D:/.localhost/.my/stylish.1misc.css");

Why wont it import?

related


回答1:


Although I am having the same issue with Chrome as well, but the statement concerning inclusion of local stylesheets in case of every browser with the exception of IE lacks merit. Opera, Firefox, and Safari all allow inclusion of local stylesheets. Safari and Opera even allow users to use stylesheets which are located anywhere on their hard disks. As the process of instructing a web browser to use a local stylesheet requires a local user's involvement, hence the chances of violating the security remain minimal to almost non existent.

As CSS files have to conform to strict rules, hence that probably provides another reason for making it possible for users to choose local CSS files from any directory on the hard disk, as browsers simply stop parsing the file in case it does not conform to predefined rules and standards.



来源:https://stackoverflow.com/questions/13482157/why-cant-i-import-from-chromes-userstylesheet-custom-css

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!