Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.59 KB | None | 0 0
  1. import QtQuick 2.4
  2. import Ubuntu.Components 1.3
  3. import Ubuntu.Web 0.2
  4. import com.canonical.Oxide 1.0 as Oxide
  5.  
  6. MainView {
  7.     objectName: "mainView"
  8.     applicationName: "netspeed.turan-mahmudov-l"
  9.  
  10.     width: units.gu(50)
  11.     height: units.gu(75)
  12.  
  13.     Page {
  14.         header: PageHeader {
  15.             id: pageHeader
  16.             title: i18n.tr("NetSpeed")
  17.             StyleHints {
  18.                 foregroundColor: "#ffffff"
  19.                 backgroundColor: "#141526"
  20.                 dividerColor: "#1cbfff"
  21.             }
  22.         }
  23.  
  24.         WebContext {
  25.             id: webcontext
  26.             userAgent: "Mozilla/5.0 (Linux; Android 4.4.4; Nexus 4 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.25 Mobile Safari/537.36"
  27.             userScripts: [
  28.                 Oxide.UserScript {
  29.                     context: "oxide://"
  30.                     url: Qt.resolvedUrl("scripts/userscript.js")
  31.                     matchAllFrames: true
  32.                 }
  33.             ]
  34.         }
  35.  
  36.         WebView {
  37.             id: webview
  38.             anchors {
  39.                top: pageHeader.bottom
  40.                bottom: parent.bottom
  41.                left: parent.left
  42.                right: parent.right
  43.             }
  44.  
  45.             context: webcontext
  46.             url: "https://fast.com/"
  47.             preferences.localStorageEnabled: true
  48.             preferences.appCacheEnabled: true
  49.             preferences.javascriptCanAccessClipboard: true
  50.             preferences.allowFileAccessFromFileUrls: true
  51.             preferences.allowUniversalAccessFromFileUrls: true
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement