How do you read CSS rule values with JavaScript?

后端 未结 16 1488
天涯浪人
天涯浪人 2020-11-21 21:02

I would like to return a string with all of the contents of a CSS rule, like the format you\'d see in an inline style. I\'d like to be able to do this without knowing what i

16条回答
  •  佛祖请我去吃肉
    2020-11-21 21:26

    I faced the same problem. And with the help of guys I came up with a really smart solution that solve that problem totally (run on chrome ) .

    Extract all images from the network

     function AllImagesUrl (domain){
      return  performance.getEntries()
        .filter( e=> 
           e.initiatorType == "img" &&
           new RegExp(domain).test(e.name) 
        )
      .map( e=> e.name.replace('some cleaning work here','') ) ```
    

提交回复
热议问题