简体   繁体   中英

Disable Chrome Extension Minification

I've been working on a Chrome extension and I have a minor annoyance with debugging my scripts. My background page is a Javascript file and it is always minified automatically by Chrome. You can see how this becomes a pain to use the developer tools on because everything is on a single line. Anyone know if this can be disabled?

To view your Chrome extension source normally:

1 open Chrome's extension management page
2 make sure developer mode is checked

在此处输入图片说明

3 click link after inspect views to open extension files in chrome developer tools window

在此处输入图片说明

4 click link to included script file in background page to view background script

在此处输入图片说明

Perhaps this is relevant.

http://www.elijahmanor.com/7-chrome-tips-developers-designers-may-not-know/

  1. The ability to Pretty Print ( aka unminify ) JavaScript source

Sometimes I'm trying to figure out a bug and unfortunately the JavaScript that was included has been minified. As you are aware trying to debug a minified file is nearly impossible. How do you set a break point on a line that is a bazillion characters long?

Thankfully Chrome has a Pretty Print feature that will take a minified JavaScript file and format it property. All you need to do is to click the "{ }" icon on the bottom toolbar to activate this feature. Of course the names will still be obfuscated ( depending on what program minfied the JavaScript in the first place ), but you will at least be able to set break points and debug the code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM