Bug 568789 - SWT Browser not displaying pages using D3
Summary: SWT Browser not displaying pages using D3
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.18   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-13 06:04 EST by Michael Haywood CLA
Modified: 2020-11-13 06:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Haywood CLA 2020-11-13 06:04:42 EST
I would like to display a html page that uses D3 in an SWT Browser.

If I load a URL like www.google.com it loads correctly and allows me to search etc. If I try loading a page that contains D3 I find that nothing gets displayed and no errors are output.

Apparently this works on Mac but not on Windows 10. 

Code: 

    public class D3BrowserExample {

    public static void main(String args[]) {
    Display display = new Display();
    final Shell shell = new Shell(display, SWT.SHELL_TRIM);
    shell.setLayout(new FillLayout());
    Browser browser = new Browser(shell, SWT.NONE);
    browser.addTitleListener(new TitleListener() {
        @Override
        public void changed(TitleEvent event) {
        shell.setText(event.title);
        }
    });
    browser.setBounds(0, 0, 1200, 900);
    shell.pack();
    shell.open();

    browser.setJavascriptEnabled(true);

    browser.setUrl("https://observablehq.com/@d3/force-directed-graph");

    browser.addProgressListener(new ProgressListener() {
        @Override
        public void completed(ProgressEvent event) {
        System.out.println("Page loaded");

        }

        @Override
        public void changed(ProgressEvent event) {
        }
    });
    
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
        display.sleep();
        }
    }
    }
}

I've tried this on another Windows 10 PC with version 4.3 of SWT. The complete method is called for the progress listener but nothing displays.

Here's a stackoverflow question I've created. 
https://stackoverflow.com/questions/64808494/swt-browser-not-displaying-pages-using-d3?noredirect=1#comment114602781_64808494