| Summary: | [Chrome] Bad plugin URLs break the Plugin List | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> |
| Component: | Client | Assignee: | Project Inbox <orion.client-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | simon_kaegi |
| Version: | 3.0 | Flags: | simon_kaegi:
review+
|
| Target Milestone: | 3.0 RC1 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| See Also: |
https://bugs.eclipse.org/bugs/show_bug.cgi?id=386080 https://bugs.eclipse.org/bugs/show_bug.cgi?id=409792 |
||
| Whiteboard: | |||
|
Description
Mark Macdonald
My PluginRegistry seems to be in an inconsistent state: when pluginRegistry.getPlugins() is called, the problematic plugin appears in the list. Its #getLocation() method returns "%3127.0.0.3:8080/index.html" (not sure what the %31 part means). When we call pluginRegistry.getPlugin() passing that same URL, it returns null. That breaks the page. The root cause is a server problem (see bug 409792), but the plugin list UI should be more robust and not blow up. Will keep this bug for the UI. FWIW: only plugin URLs with a port component (like :8080) will break the UI, and only in Chrome. This is because browsers differ in how they interpret the bogus plugin URL that is created due to bug 409792: > var temp = document.createElement("a"); > temp.href = "127.0.0.3:8080/index.html"; // A corrupt plugin URL > console.log(temp.href); In Chrome the above code prints: > "%3127.0.0.3:8080/index.html" ^ That's where the mysterious "%3" comes from: some quirk in Chrome's URL parser. In Firefox and Safari, it prints: > "http://localhost:8080/127.0.0.3:8080/index.html" If the corrupt URL does not contain a port component, Chrome parses it identically to Firefox and Safari and the page UI renders without errors. Here is a candidate fix. It normalizes plugin URLs using URL-shim rather than relying on the browser's built-in URL parsing with <A> tags. This removes Chrome's moronic URL parser from the equation. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?h=mamacdon/bug409302&id=c292d55814ea859a609313c6277dfe829794b9e3 Got the OK from simon, so released: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f993940 |