Can I add a resource using Chrome Dev Tools?

前端 未结 4 1758
春和景丽
春和景丽 2021-02-05 10:49

I\'m viewing a webpage using Chrome. The original source does not include jQuery, but it\'d be really helpful to use some jQuery functions to inspect the DOM. It would be a pain

4条回答
  •  别跟我提以往
    2021-02-05 11:14

    You should be able to run this in your JS console.

    var jq = document.createElement('script');
    jq.src = "/path/to/jQuery.min.js";
    document.getElementsByTagName('head')[0].appendChild(jq);
    jQuery.noConflict();
    

    Alternatively you can copy the entire jQuery file into the console. Not the best option, but that would work too.

    A third option is this plugin, jQueryify, I haven't used it myself, but looks promising.

提交回复
热议问题