is there a way to save css/js changes of remote resource between page reloads or map remote resource to local in devtools?

前端 未结 10 2099
时光说笑
时光说笑 2020-12-06 09:50

I know about Workspaces recently introduced in DevTools but that is not that i need. For example: page uses jquery that is loaded from CDN, i modify jquery library code, pre

10条回答
  •  -上瘾入骨i
    2020-12-06 10:25

    Note, Utilizes jQuery library (not required)

    Try, at console

    function restyle() {
      $("*").css("color", "blue"); /* development elements, css, js */
      $("head").append(""); /* js */
      var t = document.querySelectorAll("*"); /* modified document */
      var outer = document.documentElement.outerHTML; /* modified document */
      var inner = document.documentElement.innerHTML; /* modified document */
      return $.ajax() /* `pseudo` `reload` */
      .done(function(data) { /* original document */
      document.documentElement.innerHTML = outer; /* `psuudo` `document` `reload` */
      console.log(data, inner, outer, $(t)) /* options, `callbacks` */
      /* $.each($(t), function(index, value) { console.log(value) }); */
      })
    };
    restyle();
    

提交回复
热议问题