Skip to content

Commit 0f26cc1

Browse files
authored
Update README.md
1 parent 61eb97d commit 0f26cc1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ php bin/magento setup:static-content:deploy
4141
## Get List Of Used JS
4242
```
4343
/* Use in browser console */
44-
globalSrc = [];
44+
globalSrc = '';
4545
jQuery('script').each(function(){
4646
if (!jQuery(this).attr('src')) return;
47-
var src = (jQuery(this).attr('src').replace('PATH_TO_JS', ''));
48-
globalSrc.push(src)
47+
var src = jQuery(this).attr('src');
48+
if (src.indexOf('https://' + window.location.hostname) != -1 || src.indexOf('http://' + window.location.hostname) != -1) {
49+
var src = (src.replace(PATH_TO_JS, ''));
50+
globalSrc += "\n" + src;
51+
}
4952
})
50-
console.log(JSON.stringify(globalSrc));
53+
console.log(globalSrc);
54+
5155
```
5256

5357
## Support

0 commit comments

Comments
 (0)