Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick
- import QtQuick.Layouts 2.15
- import QtWebEngine
- import org.kde.kirigami 2.20 as Kirigami
- import org.kde.plasma.components 3.0 as PlasmaComponents3
- import org.kde.plasma.extras 2.0 as PlasmaExtras
- import org.kde.plasma.plasmoid 2.0
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
- WebEngineView {
- id: webView
- anchors.fill: parent
- url: plasmoid.configuration.grammarlyUrl
- settings.javascriptCanAccessClipboard: true
- settings.javascriptEnabled: true
- settings.localContentCanAccessRemoteUrls: true
- settings.localContentCanAccessFileUrls: true
- settings.screenCaptureEnabled: true
- profile: grammarlyProfile
- onLinkHovered: (hoveredUrl) => {
- if (hoveredUrl.toString() !== "")
- mouseArea.cursorShape = Qt.PointingHandCursor;
- else
- mouseArea.cursorShape = Qt.ArrowCursor;
- }
- WebEngineProfile {
- id: grammarlyProfile
- httpUserAgent: getUserAgent()
- storageName: "grammarly"
- offTheRecord: false
- httpCacheType: WebEngineProfile.DiskHttpCache
- persistentCookiesPolicy: WebEngineProfile.ForcePersistentCookies
- persistentPermissionsPolicy: WebEngineProfile.StoreOnDisk
- httpCacheMaximumSize: 2.14748e+09
- }
- }
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- acceptedButtons: Qt.BackButton | Qt.ForwardButton
- onPressed: (mouse) => {
- if (mouse.button === Qt.BackButton)
- grammarlyWebview.goBack();
- else if (mouse.button === Qt.ForwardButton)
- grammarlyWebview.goForward();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement