else if (options.Get("offscreen", &b) && b)
type_ = OFF_SCREEN;
+ // Whether to disable DevTools.
+ options.Get("disableDevTools", &disable_devtools_);
+
// Obtain the session.
std::string partition;
mate::Handle<api::Session> session;
if (type_ == REMOTE)
return;
+ if (disable_devtools_)
+ return;
+
std::string state;
if (type_ == WEB_VIEW || !owner_window()) {
state = "detach";
// Whether background throttling is disabled.
bool background_throttling_;
+ // // Whether to disable devtools.
+ bool disable_devtools_;
+
DISALLOW_COPY_AND_ASSIGN(WebContents);
};
if (options.Get("transparent", &transparent))
web_preferences.Set("transparent", transparent);
+ // Disable WebContents.OpenDevTools() ?
+ if (options.Get(options::kDisableDevTools, &value))
+ web_preferences.Set(options::kDisableDevTools, value);
+
// Creates the WebContents used by BrowserWindow.
auto web_contents = WebContents::Create(isolate, web_preferences);
web_contents_.Reset(isolate, web_contents.ToV8());
// Instancd ID of guest WebContents.
const char kGuestInstanceID[] = "guestInstanceId";
+// Diable openDevTools.
+const char kDisableDevTools[] = "disableDevTools";
+
// Web runtime features.
const char kExperimentalFeatures[] = "experimentalFeatures";
const char kExperimentalCanvasFeatures[] = "experimentalCanvasFeatures";
extern const char kHasShadow[];
extern const char kFocusable[];
extern const char kWebPreferences[];
+extern const char kDisableDevTools[];
// WebPreferences.
extern const char kZoomFactor[];