This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I'm not sure if this should work or how often it is used, but if I create dynamically <script> with external src, it is not listed in Remote Files. The same happens if you create iframe with some external page (e.g. netbeans.org) Code snippet: ... <input type="button" value="Create script" onclick="loadScript('http://netbeans.org/images_www/js/switcher.js')"/> ... <script id="emptyScript" src=""></script> <script> function loadScript(src){ $("#emptyScript").attr("src", src); // because following breaks editor - #216420 // $("document").append("<script src='"+src+"'>< /script>"); } </script> ... Product Version: NetBeans IDE Dev (Build EaselCSS-441-on-20120805) Java: 1.7.0_06-ea; Java HotSpot(TM) Client VM 23.2-b09 System: Linux version 3.0.0-23-generic running on i386; UTF-8; en_US (nb)
The problem is that unless such JS code is executed we have no idea what's being loaded. Similar case is if user is using a JS library like RequireJS. There is one way how we could improve this. When a file is run in Chrome or WebView then WebKit protocol tells us all JavaScripts it loaded in runtime. And we could cache those in project private settings and add them to Remote Files node. The problems of this solution to be aware of are: * before project is run (and *all* its JavaScript code from all possible project's files) not all remote JS files will be listed in Remote Files node * cache of these dynamically loaded remote JS files may become stale - we would not know that some remote file is not in use anymore Do you think it would be worth to implement this? Or would it be easier to say that only *statically* referenced JS files are shown under Remote Files?
If you say that Remote files are not only for "statically" declared scripts, then the first problem you mentioned would be expected behavior from my point of view. (In reply to comment #1) > * cache of these dynamically loaded remote JS files may become stale - we would > not know that some remote file is not in use anymore That could be solved if Remote files node would have some context menu with action like Refresh that would delete all dynamically added scripts and load only the statically referenced. What is the current approach with refreshing Remote Files? Are they cached (the content of files, not list), if so is there a way to refresh them?
Refresh action would solve it. That's a good idea. At the moment remote files are build from indexing data build by parsing API so it is accurate and up to date all the time.
I think this is Enhancement rather than Defect. Would you agree?
Sure, no problem
Taking over.