Implement alert/confirm through Chrome's dialog manager #8341

Merged
merged 3 commits into from Jan 9, 2017

Projects

None yet

2 participants

@kevinsawicki
Contributor
kevinsawicki commented Jan 5, 2017 edited

This allows window.alert and window.confirm to work from <iframe> tags and sandboxed windows.

Refs #2644

@kevinsawicki kevinsawicki changed the title from Implement alert/confirm through dialog manager to Implement alert/confirm through Chrome's dialog manager Jan 5, 2017
@kevinsawicki kevinsawicki requested a review from deepak1556 Jan 5, 2017
@deepak1556

The overrides in lib/renderer/override,js and lib/renderer/inspector.js can be removed ?

+
+ std::vector<std::string> buttons;
+ if (message_type == JavaScriptMessageType::JAVASCRIPT_MESSAGE_TYPE_CONFIRM) {
+ buttons.push_back("OK");
@deepak1556
deepak1556 Jan 6, 2017 Member

"OK" should be present for both confirm and alert types.

@kevinsawicki
Contributor

The overrides in lib/renderer/override,js can be removed ?

I didn't remove them because they both support a second title parameter that isn't part of the DOM API and so it isn't supported via the Chrome dialog manager. And so I didn't want to break any existing behavior where apps are passing a custom title.

We could remove them in 2.0 though.

@deepak1556
Member

Makes sense, thanks for the explanation 👍

kevinsawicki added some commits Jan 5, 2017
@kevinsawicki kevinsawicki Implement alert/confirm through dialog manager 1f08634
@kevinsawicki kevinsawicki Use correct param ordering in header file 222734b
@kevinsawicki kevinsawicki Add OK button to alert
6ef1a91
@kevinsawicki kevinsawicki merged commit 871c3fc into master Jan 9, 2017

7 of 9 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
electron-linux-arm Build #5129729 succeeded in 66s
Details
electron-linux-ia32 Build #5129730 succeeded in 171s
Details
electron-linux-x64 Build #5129731 succeeded in 237s
Details
electron-mas-x64 Build #3118 succeeded in 8 min 50 sec
Details
electron-osx-x64 Build #3131 succeeded in 8 min 58 sec
Details
electron-win-ia32 Build #2165 succeeded in 13 min
Details
electron-win-x64 Build #2153 succeeded in 13 min
Details
@kevinsawicki kevinsawicki deleted the dialog-manager branch Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment