Skip to content

Commit 28f175d

Browse files
authored
Update README.md
1 parent 054eae1 commit 28f175d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@
1919
## Get List Of Used JS On A Sigle Page
2020
```
2121
/* Use in browser console */
22-
/* Replace PATH_TO_JS with a string of static content URL including language. E.g.
23-
'https://domain.com/pub/static/version1549034518/frontend/Magento/luma/en_US/'
24-
*/
2522
globalSrc = '';
2623
jQuery('script').each(function(){
2724
if (!jQuery(this).attr('src')) return;
2825
var src = jQuery(this).attr('src');
29-
if (src.indexOf('https://' + window.location.hostname) != -1 || src.indexOf('http://' + window.location.hostname) != -1) {
30-
var src = (src.replace(PATH_TO_JS, ''));
26+
if (src.indexOf(require.toUrl('')) != -1) {
27+
var src = (src.replace(require.toUrl(''), ''));
3128
globalSrc += "\n" + src;
3229
}
3330
})

0 commit comments

Comments
 (0)