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

Reload BrowserView of window #10921

Closed
sandor opened this issue Oct 26, 2017 · 1 comment
Closed

Reload BrowserView of window #10921

sandor opened this issue Oct 26, 2017 · 1 comment

Comments

@sandor
Copy link

sandor commented Oct 26, 2017

electron 1.8.2. beta 2
osx 10.11.6

How is supposed to get the attached BrowserView of a window? Specially I would like to refresh the contents of the browser view in togehter with the window when I resize it. This is what I'm doing now:

    menu.append(new MenuItem({
        label: 'Apple MacBook',
        submenu: [{
            label: 'MacBook',
            click() {
                var window = remote.getCurrentWindow();
                window.setSize(1152, 761);
                window.setAspectRatio(16 / 10);
                document.getElementById("device").innerHTML = "Apple MacBook | 1152 x 720";
            }
        }, {
            label: 'MacBook Air',
            click() {
                var window = remote.getCurrentWindow();
                window.setSize(1440, 941);
                window.setAspectRatio(16 / 10);
                document.getElementById("device").innerHTML = "Apple MacBook Air | 1440 x 900";
            }
        }, {
            label: 'MacBook Pro',
            click() {
                var window = remote.getCurrentWindow();
                window.setSize(1440, 941);
                window.setAspectRatio(16 / 10);
                document.getElementById("device").innerHTML = "Apple MacBook Pro | 1440 x 900";
            }
        }, ]
    }))
@felixrieseberg
Copy link
Member

This was mostly a documentation issue - you can call getBrowserView on a BrowserWindow. PR that fixes documentation (and adds a spec) incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants