Reading documents CSS in Chrome Extension

后端 未结 4 1491
春和景丽
春和景丽 2020-12-10 20:44

I am trying to read the pages CSS using a chrome extension. This is what i have in my content script :

   var allSheets = document.styleSheets;
     for (var         


        
4条回答
  •  臣服心动
    2020-12-10 21:14

    Just a guess, but since chrome extensions are Javascript based, they may have cross domain issues. Chrome sets the rules and cssRules to null when programmatically trying to get a stylesheet from another domain.

提交回复
热议问题