软件、硬件定制开发,联系QQ:99605319

本文由 资源共享网 – ziyuan 发布,转载请注明出处,如有问题请联系我们!解密利用css的before和after属性防复制采集的方法和js代码

收藏

下面的代码注入页面就可以复制采集了


<script type="text/javascript">
window.onload = function() {
css=document.styleSheets[0].cssRules;
ect.keys(css).forEach(function(k,v){
        stylename=css[k].selectorText.split('::')[0];
        content=css[k].style.content.replaceAll('"','');
        document.querySelectorAll(stylename).forEach(function(ek,ev){
                ek.replaceWith(content);
        });
});
};
</script>


油猴脚本(Tampermonkey)用下面的脚本

(function() {
    'use strict';
    var css=unsafeWindow.document.styleSheets[0].cssRules;
    Object.keys(css).forEach(function(k,v){
        var stylename=css[k].selectorText.split('::')[0];
        var content=css[k].style.content.replaceAll('"','');
        unsafeWindow.document.querySelectorAll(stylename).forEach(function(ek,ev){
            ek.replaceWith(content);
        });
    });
})();



技术文章资源(解密利用css的before和after属性防复制采集的方法和js代码)网址:https://www.08i8.com/course/detail500.html;转载请注明!


评论(0条)

请登录后评论
ziyuan

ziyuan Rank: 16

0

0

0

( 此人很懒并没有留下什么~~ )

首页

栏目

搜索

会员