-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
feat: add enableWebSQL webpreference #23311
Conversation
@@ -385,6 +385,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`. | |||
visible to users. | |||
* `spellcheck` Boolean (optional) - Whether to enable the builtin spellchecker. | |||
Default is `true`. | |||
* `enableWebSQL` Boolean (optional) - Whether to enable the [WebSQL api](https://www.w3.org/TR/webdatabase/). | |||
Default is `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we plan to set the default to false in a followup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats up for discussion, I didn't know if we wanted to keep it enabled by default upto a certain electron version and then disable it ?
if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | ||
switches::kEnableWebSQL)) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a purely renderer-side check? Is there any way we can disable this browser-side as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't disable on browser side in an isolated way, it only manages quota for storage and establishes connection to SQLite https://source.chromium.org/chromium/chromium/src/+/master:storage/browser/database/
The renderer side check is pretty consistent and powerful.
There is flag --disable-databases
https://source.chromium.org/chromium/chromium/src/+/master:content/public/common/content_switches.cc;l=116 but it would disable both indexedDB and webSQL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a renderer-side check only, then I think this being a process-wide switch rather than a per-RenderFrame switch is wrong. However, since most of our other web preferences have the same issue, I won't block this PR on the issue.
Thanks @nornagon , but we don't currently expose a way to set per RenderFrame flags from the browser process. We have to expose the Is there another approach you have in mind ? |
Not currently, I think this is something @loc is exploring. |
Cool, thanks! Failing tests are unrelated, merging. |
Release Notes Persisted
|
/trop run backport-to 9-x-y |
The backport process for this PR has been manually initiated - |
/trop run backport-to 8-x-y |
I have automatically backported this PR to "9-x-y", please check out #23580 |
The backport process for this PR has been manually initiated - |
I was unable to backport this PR to "8-x-y" cleanly; |
@deepak1556 has manually backported this PR to "8-x-y", please check out #23581 |
@deepak1556 has manually backported this PR to "7-2-x", please check out #23582 |
* feat: add enableWebSQL webpreference (#23311) * fix tests
Description of Change
Allows to disable websql api in a backward compatible way
Checklist
npm test
passesRelease Notes
Notes: enableWebSQL is a new webpreference option to enable/disable websql api