Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.0
- import Sailfish.Silica 1.0
- import Sailfish.WebView 1.0
- Page {
- id: root
- allowedOrientations: Orientation.All
- backNavigation: false
- PageHeader {
- id: header
- objectName: "pageHeader"
- title: "<= Click me to add a cookie"
- extraContent.children: [
- IconButton {
- objectName: "addCookie"
- icon.source: "image://theme/icon-s-attach"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: {
- console.log("A cookie was added")
- webView.runJavaScript("document.cookie = \"name=test; path=/\";");
- }
- }
- ]
- }
- WebView {
- id: webView
- objectName: "webView"
- url: "https://ya.ru/"
- anchors {
- left: parent.left
- top: header.bottom
- bottom: parent.bottom
- right: parent.right
- }
- }
- }
Add Comment
Please, Sign In to add comment