Skip to content
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

New features in Qt 5.10 #2939

Closed
9 tasks done
The-Compiler opened this issue Aug 30, 2017 · 5 comments
Closed
9 tasks done

New features in Qt 5.10 #2939

The-Compiler opened this issue Aug 30, 2017 · 5 comments
Labels
component: QtWebEngine Issues related to the QtWebEngine backend, based on Chromium. priority: 1 - middle Issues which should be done at some point, but aren't that important.

Comments

@The-Compiler
Copy link
Member

The-Compiler commented Aug 30, 2017

Some new Qt 5.10 features related to qutebrowser:

@The-Compiler The-Compiler added component: QtWebEngine Issues related to the QtWebEngine backend, based on Chromium. priority: 1 - middle Issues which should be done at some point, but aren't that important. qt: 5.10 labels Aug 30, 2017
@laurynas-karvelis
Copy link

laurynas-karvelis commented Sep 15, 2017

I'd say keep the browser simple and less intrusive to people. If I want to use spyware, I just open Chromium. On the other hand, qutebrowser is like first love, it always stays pure and untouched. My two cents are to add config settings to optionally enable such features as DesktopVideo(Audio)Capture/MouseLock etc as enable-able only.

KISS & Suckless! Look at dwm, it's a gem. Right now, qutebrowser is like that.

@The-Compiler
Copy link
Member Author

Like the other permissions already, those will probably have a setting you can set to true/false/ask, with the default being ask.

@The-Compiler The-Compiler changed the title New QtWebEngine features in Qt 5.10 New features in Qt 5.10 Nov 16, 2017
@rnhmjoj
Copy link
Contributor

rnhmjoj commented Mar 23, 2018

So, about the spell check dictionaries... I have some free time and I'm willing to do it.
How would you keep compatibility with older Qt version? Use XDG_DATA_HOME if Qt is 5.10 and fallback to the system path otherwise?

Another issue I have found: the script calls imports browser.webengine.spell and then calls qutebrowser.utils.standarddir which not initialized, so I had to "manually" read the environment to get the path.

@The-Compiler
Copy link
Member Author

I opened #3759 for QTWEBENGINE_DICTIONARIES_PATH - let's continue this there 😉

@The-Compiler
Copy link
Member Author

Tried window.focus() support, but it doesn't seem to work properly:

diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc
index 3479f7301..7feb70426 100644
--- a/doc/help/settings.asciidoc
+++ b/doc/help/settings.asciidoc
@@ -133,6 +133,7 @@
 |<<content.javascript.alert,content.javascript.alert>>|Show javascript alerts.
 |<<content.javascript.can_access_clipboard,content.javascript.can_access_clipboard>>|Allow JavaScript to read from or write to the clipboard.
 |<<content.javascript.can_close_tabs,content.javascript.can_close_tabs>>|Allow JavaScript to close tabs.
+|<<content.javascript.can_focus_window,content.javascript.can_focus_window>>|Allow JavaScript to focus the window.
 |<<content.javascript.can_open_tabs_automatically,content.javascript.can_open_tabs_automatically>>|Allow JavaScript to open new tabs without user interaction.
 |<<content.javascript.enabled,content.javascript.enabled>>|Enable JavaScript.
 |<<content.javascript.log,content.javascript.log>>|Log levels to use for JavaScript console logging messages.
@@ -1745,6 +1746,18 @@ Default: +pass:[false]+
 
 This setting is only available with the QtWebKit backend.
 
+[[content.javascript.can_focus_window]]
+=== content.javascript.can_focus_window
+Allow JavaScript to focus the window.
+
+Type: <<types,Bool>>
+
+Default: +pass:[false]+
+
+On QtWebEngine, this setting requires Qt 5.10 or newer.
+
+On QtWebKit, this setting is unavailable.
+
 [[content.javascript.can_open_tabs_automatically]]
 === content.javascript.can_open_tabs_automatically
 Allow JavaScript to open new tabs without user interaction.
diff --git a/qutebrowser/browser/webengine/webenginesettings.py b/qutebrowser/browser/webengine/webenginesettings.py
index 2c44684e8..bd93ea50d 100644
--- a/qutebrowser/browser/webengine/webenginesettings.py
+++ b/qutebrowser/browser/webengine/webenginesettings.py
@@ -163,6 +163,9 @@ class WebEngineSettings(websettings.AbstractSettings):
             # Qt 5.8
             'content.print_element_backgrounds':
                 ('PrintElementBackgrounds', None),
+            # Qt 5.10
+            'content.javascript.can_focus_window':
+                ('AllowWindowActivationFromJavaScript', None),
             # Qt 5.11
             'content.autoplay':
                 ('PlaybackRequiresUserGesture', lambda val: not val),
diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml
index a137489fd..0a23e7015 100644
--- a/qutebrowser/config/configdata.yml
+++ b/qutebrowser/config/configdata.yml
@@ -511,6 +511,14 @@ content.javascript.can_close_tabs:
   supports_pattern: true
   desc: Allow JavaScript to close tabs.
 
+content.javascript.can_focus_window:
+  default: false
+  type: Bool
+  backend:
+    QtWebKit: false
+    QtWebEngine: Qt 5.10
+  desc: Allow JavaScript to focus the window.
+
 content.javascript.can_open_tabs_automatically:
   default: false
   type: Bool

dropping it for now, which means everything here is either done or split into another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: QtWebEngine Issues related to the QtWebEngine backend, based on Chromium. priority: 1 - middle Issues which should be done at some point, but aren't that important.
Projects
None yet
Development

No branches or pull requests

3 participants