Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Welcome page has missing color and styling with Edge browser in Eclipse #213

Open
niraj-modi opened this issue Jun 20, 2022 · 6 comments
Open
Labels
edge Edge Browser Windows Happens on Windows OS

Comments

@niraj-modi
Copy link
Member

Describe the bug
This bug is to support improved Edge based Welcome page in Eclipse, original bugzilla bug report:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=578700

To Reproduce
When Eclipse is launched with Edge browser:

  • Welcome page has missing color and styling.

Expected behavior
Welcome page should show color and styling similar to embedded IE.

Screenshots
https://bugzillaattachments.eclipsecontent.org/bugs/attachment.cgi?id=285442

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS
  1. Additional OS info (e.g. OS version, Linux Desktop, etc)

  2. JRE/JDK version

Version since
4.19

Workaround (or) Additional context
Use embedded IE instead of Edge.

@niraj-modi niraj-modi added Windows Happens on Windows OS edge Edge Browser labels Jun 20, 2022
@thegreystone
Copy link

This one would be very interesting for https://github.com/openjdk/jmc. The embedded IE is old enough that most new views in Mission Control (that are using various popular Java Script visualization frameworks) do not work on Windows. Not being able to load local resources is a huge problem.

MicrosoftEdge/WebView2Feedback#456

@thegreystone
Copy link

Also, see https://bugs.openjdk.org/browse/JMC-7118.

@viragpurnam
Copy link

viragpurnam commented Jun 8, 2023

Hi, we have a similar requirement. We have designed some views using Java Script. These views work absolutely fine on Mac and Linux platforms but not on Windows. Unfortunately, most of the users are on windows and they are not able to use these views. (These views are the main feature of the tool). Could you please take this bug on priority? This will surely help many developers. Thanks. Looking forward for a positive response.

@laeubi
Copy link
Contributor

laeubi commented Jun 8, 2023

Could you please take this bug on priority?

You can contact the Eclipse-WG and offer some funding for this particular issue getting fixed:

https://eclipseide.org/working-group/#members

This will surely help many developers.

... or some of the "many developers" can take a look and provide a PR to fix this.

@Phillipus
Copy link
Contributor

Phillipus commented Jun 11, 2023

Correct me if I'm wrong, but my understanding is that calling Browser.setText("some html") where the html text includes references to local files (CSS and JS) is not permitted by Edge, so the Welcome page doesn't display properly. Therefore this can't be fixed in Eclipse and SWT.

BrowserIntroPartImplementation calls Browser#setText() for HTML based Intro pages and so local images and CSS file are not loaded as noted here.

In our app we only have one welcome page so I inlined the CSS and converted images to embedded Base64 strings into a single HTML page.

Could you please take this bug on priority?

Have you come up with a fix or workaround yet?

@Phillipus
Copy link
Contributor

Phillipus commented Oct 21, 2023

For reference, the issue arises when calling Browser#setText() which in the org.eclipse.swt.browser.Edge class calls the ICoreWebView2#NavigateToString method.

The MS documentation for this says:

Loading local content by using the NavigateToString method doesn't make it possible for the resulting document to reference additional web resources such as CSS, image, or script files. The method only lets you specify the string content of the HTML document. To reference additional web resources from your HTML document, use one of the other approaches described in this article, or represent those additional web resources inline in the HTML document.

In the Eclipse IDE there are two obvious places where this is impacted - Welcome pages (images, CSS and JS not loaded) and Javadoc hover tips in the editor (images are not displayed, not sure if links or formatting works or not). So the choices are:

  1. Don't use a Browser for these components
  2. Change the Browser#setText() usage so that all CSS, JS and images are embedded in the HTML string (images will have to be converted to Base64 strings)
  3. Create a temporary file so that the html is loaded by calling Browser#setUrl()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
edge Edge Browser Windows Happens on Windows OS
Projects
None yet
Development

No branches or pull requests

5 participants