Community
Participate
Working Groups
Build Identifier: I20091201-1600 Internal web browser has sometimes problem with refresh its content when open new page. Moreover this problem disappears when you click "refresh" button. I have observed such situation when IE8 has been installed and did not happen for me on IE6 (tested on 2 computers). Moreover, on external web browser the problem does not appear even if it is set to IE8. Reproducible: Always Steps to Reproduce: You must have IE8 installed. 1. Create new dynamic web project and add index.html file in WebContent directory. 2. Right click on index.html file. Select "Run as -> Run on Server". You should see html file in your internal browser. 3. Modify index.html content. Select "Run as -> Run on Server" again. You get old content of file.
The problem occurs when you want to open any page opened before e.g. if you open address A, then, in the same browser address B, and again A, you get finally old version of web page A.
I tried add if (browser.setUrl(url)) { browser.refresh(); return true; } at org.eclipse.ui.internal.browser.BrowserViewer:621 (refresh after setting url), but from unknown reasons, such workaround does not work. It my be problem with method org.eclipse.swt.browser.IE.navigate(String url, String postData, String headers[], boolean silent) or anonymous listener at org.eclipse.swt.browser.IE:268. Unfortunately I am not OLE specialst :(
(In reply to comment #1) > The problem occurs when you want to open any page opened before e.g. if you > open address A, then, in the same browser address B, and again A, you get > finally old version of web page A. Generally the method of caching and display of internal browser is the same as IE (except refreshing when the address is the same), but in my opinion it is not right. Internal Web browser should always fetch content from server, not from cache.
Created attachment 156076 [details] Patch to 3.6 This patch sets flag navNoReadFromCache in Navigate method if IE8
Created attachment 156096 [details] patch to 3.5
Created attachment 156353 [details] Corrected patch to 3.5
Created attachment 156354 [details] Patch to 3.6
Created attachment 156356 [details] patch to 3.4
Grant could you review theses patches?
I see the behaviour you describe, even when embedding IE6. However this is the correct behaviour. It matches what the Browser does when embedding Mozilla and Safari, and also matches stand-alone IE, Mozilla and Safari. The Browser's default setUrl() behaviour cannot be changed to ignore the cache, even though it would help in this case. I think there are two possibilities: 1. The Browser could add API to expose this behaviour (eg.- a boolean "bypassCache" on setUrl()) if support for this exists in all native browsers. There's a similar but reversed request of this in bug 295458. [It's strange that the MSDN doc at http://msdn.microsoft.com/en-us/library/aa768360(VS.85).aspx for navNoReadFromCache just says "Not implemented".] 2. Your attempt to refresh() after setting the url in comment 2 probably didn't work because the browser is asynchronous. The following should work: browser.addProgressListener(new ProgressAdapter() { public void completed(ProgressEvent event) { browser.removeProgressListener(this); browser.refresh(); // <---- } }); browser.setUrl("http://..."); Taking ownership of report in case there are further discussions about this issue. Otherwise it will be closed as WONTFIX.
It has been opened bug to the second possibility: https://bugs.eclipse.org/bugs/show_bug.cgi?id=300174
Since there is a path for accomplishing this with the existing setUrl() API that takes header arguments (detailed in bug 300174), I don't think new Browser API will be added to specifically handle this case. Closing as WONTFIX.