1. 17 Sep, 2020 1 commit
  2. 30 Aug, 2020 1 commit
    • Stefano Crocco's avatar
      Add a Wallet submenu to the Tools menu · 9eeb270f
      Stefano Crocco authored
      The menu contains the same actions as the popup menu you get when
      clicking on the wallet icon. This makes the actions easier to discover
      and allows to access them using only the keyboard. Besides, it allows to
      assign shortcuts to them.
      9eeb270f
  3. 23 Aug, 2020 1 commit
    • Stefano Crocco's avatar
      Display different wallet icon depending on whether cached data exists · 73ecc2e1
      Stefano Crocco authored
      With the previous improvement to the KWallet integration, the open wallet
      icon was displayed in the status bar whenever the current page
      contained web forms, regardless of whether or not there was cached data.
      This is confusing for the user.
      
      Now if the web page contains forms but there's no cached data for it,
      the closed walled icon is displayed instead. This way, the user
      knows that there's to possibility to use the KWallet integration for the
      current page but that there's no cached data for it.
      73ecc2e1
  4. 22 Aug, 2020 1 commit
    • Stefano Crocco's avatar
      Improve integration with KWallet · 3c109c19
      Stefano Crocco authored
      Konqueror fails to save user credentials in many sites for two reasons:
      - the site sets the autocomplete attribute to off for the fields (I
        can't understand whether this is an oversight or a conscious choice)
      - clicking the "login" (or similar) button causes
        QWebEnginePage::acceptNavigationRequest with a type argument different
        from NavigationTypeFormSubmitted. Since Konqueror uses that value to
        decide whether credentials should be saved or not, it doesn't save
        them.
      
      Given this situation, I believe that there's no simple way to
      automatically detect when credential saving and loading should be
      applied, so I decided to give the user the ability to manually choose
      which fields should be saved and to manually save them. In practice, I
      added three entries to the KWallet popup menu in Konqueror:
      - one displays a dialog where the user can choose which of the
        fields in the current page should be saved in KWallet. This allows to
        override the autocomplete=off HTML attribute
      - one allows to remove the customization described above
      - one immediately saves the credentials to KWallet, allowing
        to work around the NavigationTypeFormSubmitted issue.
      3c109c19
  5. 19 Jul, 2020 1 commit
    • Stefano Crocco's avatar
      Add support for full screen web pages · bc3a0717
      Stefano Crocco authored
      Konqueror already has a full screen mode where the menu bar and the
      title bar are hidden and the window takes all the space in the screen.
      However, this isn't enough as some web pages (for example when those
      playing a video) now expect a full screen mode (which I call complete
      full screen) where an element of the page, and not just the window,
      takes all the screen.
      
      To achieve this kind of full screen, it's necessary to hide not only the
      menu bar and the title bar, but also the status bar, the tab bar and the
      tool bars. In theory, also the side bar and the terminal emulator should
      be hidden, but this commit doesn't to that.
      
      When switching to a different tab, the complete full screen mode is
      automatically exited (because it's strictly related to the contents
      of the page). Complete full screen mode is NOT entered again
      automatically when switching back to the previous page. This is
      consistent with the behavior of other browsers such as Chrome or
      FireFox.
      
      If Konqueror is exited while in complete full screen mode, its main
      window settings are not saved.
      bc3a0717
  6. 23 Jun, 2019 1 commit
    • Stefano Crocco's avatar
      Register custom protocols using QWebEngineUrlScheme · 9552130e
      Stefano Crocco authored
      Summary:
      From Qt 5.12.0, before installing custom url scheme handlers, the scheme
      itself must be registered using QWebEngineUrlScheme.
      
      Registering URL schemes must be done before instantiating any
      QWebEngine class, so we do that at the beginning of WebEnginePart's
      constructor using a static function which only does the registration
      the first time it's called.
      
      Having to register url schemes before creating QWebEngine classes
      creates a problem beacuse we install scheme handlers dynamically from
      WebEnginePart::openUrl if the default mimetype for the URL (according to
      KProtocolManager::defaultMimeType) is 'text/html'. To avoid this issue,
      we use KProtocolInfo::protocols to obtain a list of all availlable
      protocols, create a fake URL for that protocol (as there's no way I can
      see to obtain the default mimetype for a protocol from KProtocolInfo)
      and use KProtocolManager::defaultMimeType on this URL to decide whether
      to register the URL scheme or not.
      
      Using QWebEngineUrlScheme also allows to specify that a given protocol can
      access local files, removing the need to use the html embedder from
      WebEnginePartKioHandler. Since this only works with Qt 5.12 or later, the html
      embedder is only disabled depending on the Qt version in use.
      
      Test Plan:
      run Konqueror with Qt 5.12 and check that no warnings about
      registering custom protocol are displayed on the terminal. Ensure that protocols
      such as about:, error:, man:, info: work correctly (for example, try man:cp or
      info:cp)
      
      Reviewers: dfaure
      
      Reviewed By: dfaure
      
      Differential Revision: https://phabricator.kde.org/D21741
      9552130e
  7. 10 Jan, 2019 1 commit
  8. 06 Jan, 2019 2 commits
  9. 19 Sep, 2018 1 commit
  10. 16 Jul, 2018 1 commit
    • Stefano Crocco's avatar
      Restore the ability to view man and info pages from Konqueror · d0842c88
      Stefano Crocco authored
      Summary:
      Add a QWebEngineUrlSchemeHandler which uses `KIO::get` to produce HTML code to be sent using `QWebEngineUrlRequestJob::reply`. This scheme handler is added whenever `WebEnginePart::openUrl` is called for an URL for which `KProtocolManager::defaultMimetype` returns `text/html`.
      
      The basic idea is taken from the implementation used in the `webengine_stream` branch, but instead of changing the way `KonqView::openUrl` works, it only adds the appropriate scheme handler.
      
      The main issue for this implementation to work is that QWebEngine refuses to load local resources in the generated HTML (images and CSS files) because of cross-origin rules. The only way to work around this limitation that I could think of is to parse the HTML code produced by `KIO::get` and to replace, in `img` and `link` elements the URL with a `data` URL embedding the content of the file. To do this, the scheme handler uses the external program **htmltidy** to convert the HTML generated by KIO into `XHTML`, then uses `QDomDocument` to parse the resulting XHTML file and replace the URLs appropriately. If one of these two steps fails, the original HTML will be used: this means that the user won't be able to see most of the formatting in the man/info pages but will be able to read the text.
      
      Unfortunately, there's still a problem I couldn't solve: some resources in the HTML produced by KIO use a `help` URL rather than the standard `file` one, but I couldn't find out to which file they point, so they aren't changed, meaning that the page is not displayed completely as it was intended.
      
      Test Plan: Open man and info pages from location bar and following links between such pages.
      
      Reviewers: dfaure
      
      Reviewed By: dfaure
      
      Subscribers: pino
      
      Differential Revision: https://phabricator.kde.org/D13924
      d0842c88
  11. 25 Jun, 2018 1 commit
    • Stefano Crocco's avatar
      Display an error page for error URLs in WebEnginePart · 81e224f9
      Stefano Crocco authored
      Summary:
      When asked to display an error URL, WebEnginePart displayed another
      error telling that the web page "error:/..." can't be reached.
      
      To avoid this, add a scheme handler for the "error" scheme to the default
      profile. The handler replies with the html code read from an error.html page
      with placeholders replaced by the error details contained in the URL.
      
      The code used to produce the error page is taken, with small changes, by
      webpage.cpp from KWebKitPart. The error page, too is taken from KWebKitPart and
      modified a little.
      
      Test Plan:
      Entered an invalid URL in address bar and checked that the error message was
      displayed correctly.
      
      Reviewers: dfaure
      
      Reviewed By: dfaure
      
      Subscribers: anthonyfieroni
      
      Differential Revision: https://phabricator.kde.org/D12637
      81e224f9
  12. 04 Feb, 2018 1 commit
    • Stefano Crocco's avatar
      Add back KWallet support to Konqueror · 56ea2a32
      Stefano Crocco authored
      Summary:
      Added back the ability to store user names and passwords to KWallet and automatically fill them when loading a page.
      
      I copied the files `kwebwallet.cpp` and `kwebwallet.h` from the `KDEWebKit` framework and modified it to adapt to `QWebEngine`. In particular, I needed to modify the way form data is passed from javascript to C++ serializing it using JSON and read it back using `QJsonDocument`. Also, since `QWebEnginePage` doesn't allow to access frames from the C++ side, I needed to remove all the code dealing with recurisve searches and implement it in javascript.
      
      As the old code, this intentionally doesn't work with input elements with the `autocomplete` attribute set to `false`.
      
      I've not modified the copyright information in the files I copied from `KDEWebKit` as I don't know which is the correct way to do so: I must make clear my files are based on the work on other people but at the same time that I've changed them: how do I do this?
      
      Test Plan: I tried to access several sites requiring a login in, asking Konqueror to save the password, then logging out and visiting the page again. Except when the `autocomplete` attribute was `false` (checked by looking at the html code), Konqueror always saved and restored login information correctly.
      
      Reviewers: dfaure
      
      Reviewed By: dfaure
      
      Differential Revision: https://phabricator.kde.org/D10178
      56ea2a32
  13. 02 Dec, 2016 1 commit
  14. 05 Nov, 2016 1 commit
  15. 01 Nov, 2016 3 commits
  16. 29 Oct, 2016 2 commits
  17. 22 Oct, 2016 1 commit
  18. 21 Oct, 2016 1 commit