change the option name to devTools
This commit is contained in:
parent
7d712b77ba
commit
3fdc99c3c6
3 changed files with 10 additions and 10 deletions
|
@ -262,7 +262,7 @@ WebContents::WebContents(v8::Isolate* isolate,
|
||||||
type_(REMOTE),
|
type_(REMOTE),
|
||||||
request_id_(0),
|
request_id_(0),
|
||||||
background_throttling_(true),
|
background_throttling_(true),
|
||||||
disable_devtools_(false) {
|
enable_devtools_(true) {
|
||||||
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
|
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
|
||||||
|
|
||||||
Init(isolate);
|
Init(isolate);
|
||||||
|
@ -275,7 +275,7 @@ WebContents::WebContents(v8::Isolate* isolate,
|
||||||
type_(BROWSER_WINDOW),
|
type_(BROWSER_WINDOW),
|
||||||
request_id_(0),
|
request_id_(0),
|
||||||
background_throttling_(true),
|
background_throttling_(true),
|
||||||
disable_devtools_(false) {
|
enable_devtools_(true) {
|
||||||
// Read options.
|
// Read options.
|
||||||
options.Get("backgroundThrottling", &background_throttling_);
|
options.Get("backgroundThrottling", &background_throttling_);
|
||||||
|
|
||||||
|
@ -292,8 +292,8 @@ WebContents::WebContents(v8::Isolate* isolate,
|
||||||
else if (options.Get("offscreen", &b) && b)
|
else if (options.Get("offscreen", &b) && b)
|
||||||
type_ = OFF_SCREEN;
|
type_ = OFF_SCREEN;
|
||||||
|
|
||||||
// Whether to disable DevTools.
|
// Whether to enable DevTools.
|
||||||
options.Get("disableDevTools", &disable_devtools_);
|
options.Get("devTools", &enable_devtools_);
|
||||||
|
|
||||||
// Obtain the session.
|
// Obtain the session.
|
||||||
std::string partition;
|
std::string partition;
|
||||||
|
@ -945,7 +945,7 @@ void WebContents::OpenDevTools(mate::Arguments* args) {
|
||||||
if (type_ == REMOTE)
|
if (type_ == REMOTE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (disable_devtools_)
|
if (!enable_devtools_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::string state;
|
std::string state;
|
||||||
|
@ -1012,7 +1012,7 @@ void WebContents::InspectElement(int x, int y) {
|
||||||
if (type_ == REMOTE)
|
if (type_ == REMOTE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (disable_devtools_)
|
if (!enable_devtools_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!managed_web_contents()->GetDevToolsWebContents())
|
if (!managed_web_contents()->GetDevToolsWebContents())
|
||||||
|
@ -1026,7 +1026,7 @@ void WebContents::InspectServiceWorker() {
|
||||||
if (type_ == REMOTE)
|
if (type_ == REMOTE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (disable_devtools_)
|
if (!enable_devtools_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (const auto& agent_host : content::DevToolsAgentHost::GetOrCreateAll()) {
|
for (const auto& agent_host : content::DevToolsAgentHost::GetOrCreateAll()) {
|
||||||
|
|
|
@ -323,8 +323,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
// Whether background throttling is disabled.
|
// Whether background throttling is disabled.
|
||||||
bool background_throttling_;
|
bool background_throttling_;
|
||||||
|
|
||||||
// Whether to disable devtools.
|
// Whether to enable devtools.
|
||||||
bool disable_devtools_;
|
bool enable_devtools_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WebContents);
|
DISALLOW_COPY_AND_ASSIGN(WebContents);
|
||||||
};
|
};
|
||||||
|
|
|
@ -225,7 +225,7 @@ Possible values of the `titleBarStyle` option are:
|
||||||
|
|
||||||
The `webPreferences` option is an object that can have the following properties:
|
The `webPreferences` option is an object that can have the following properties:
|
||||||
|
|
||||||
* `disableDevTools` Boolean - Whether to disable DevTools. If it is set to `true`, can not use `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `false`.
|
* `devTools` Boolean - Whether to enable DevTools. If it is set to `false`, can not use `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
|
||||||
* `nodeIntegration` Boolean - Whether node integration is enabled. Default
|
* `nodeIntegration` Boolean - Whether node integration is enabled. Default
|
||||||
is `true`.
|
is `true`.
|
||||||
* `preload` String - Specifies a script that will be loaded before other
|
* `preload` String - Specifies a script that will be loaded before other
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue