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

前端 未结 10 2098
时光说笑
时光说笑 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条回答
  •  無奈伤痛
    2020-12-06 10:34

    It is possible, but quite tricky:

    • open resources and right clik to the folder with styles\resources (fo not forget to click "allow" on the dialog that appears below the adress bar)
    • then right click on the concrete resource and choose "save as" (save it to the working directory that you specified in the prev step)
    • then right click to the same resource and choose "Map to file system resource" (write the same name as in prev. step, e.g. all.css but not all.css?id=234234234, just in case)
    • modify the styles in the dev tools.
    • refresh the page (and realise that all you modifications doesn't applied)
    • open resources, find your workspace folder and your resource in it (e.g. all.css)
    • right click on that resource and choose "local modifications"
    • in opened console click to "apply original content" and realise that you styles has been applied =) It's quit a tricky way and the better idea is to use something like fiddler to replace resources to local files.

提交回复
热议问题