switches::kOverlayScrollbars,
switches::kOverlayFullscreenVideo,
switches::kSharedWorker,
+ switches::kPageVisibility,
};
std::string RemoveWhitespace(const std::string& str) {
const char kOverlayFullscreenVideo[] = "overlay-fullscreen-video";
const char kSharedWorker[] = "shared-worker";
+// Set page visiblity to always visible.
+const char kPageVisibility[] = "page-visibility";
+
// Disable HTTP cache.
const char kDisableHttpCache[] = "disable-http-cache";
extern const char kOverlayScrollbars[];
extern const char kOverlayFullscreenVideo[];
extern const char kSharedWorker[];
+extern const char kPageVisibility[];
extern const char kDisableHttpCache[];
}
}
+bool AtomRendererClient::ShouldOverridePageVisibilityState(
+ const content::RenderFrame* render_frame,
+ blink::WebPageVisibilityState* override_state) {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ bool b;
+
+ if (IsSwitchEnabled(command_line, switches::kPageVisibility, &b)
+ && b) {
+ *override_state = blink::WebPageVisibilityStateVisible;
+ return true;
+ }
+
+ return false;
+}
+
void AtomRendererClient::EnableWebRuntimeFeatures() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
bool b;
content::RenderFrame* render_frame,
const std::string& mime_type,
const GURL& original_url) override;
+ bool ShouldOverridePageVisibilityState(
+ const content::RenderFrame* render_frame,
+ blink::WebPageVisibilityState* override_state) override;
void EnableWebRuntimeFeatures();
* `shared-worker` Boolean
* `direct-write` Boolean - Whether the DirectWrite font rendering system on
Windows is enabled
+ * `page-visibility` Boolean - Sets the page visibility state
+ to visible, prevents throttling of DOM timers.
Creates a new `BrowserWindow` with native properties set by the `options`.
Usually you only need to set the `width` and `height`, other properties will