Ubuntu Pastebin

Paste from daker at Mon, 5 Jan 2015 20:27:00 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import QtQuick 2.0
import com.canonical.Oxide 1.0 as Oxide

Oxide.WebView {
    id: webview


    Component.onCompleted: {
        url = "http://daker.me"
    }

    function navigationRequestedDelegate(request) {
        console.log(request);
        var url = request.url.toString()

        /*if (url == "http://daker.me/2014/08/everything-you-need-to-know-about-html5-video.html") {
            request.action = Oxide.NavigationRequest.ActionReject
            Qt.openUrlExternally(url)
            return
        }*/
        console.log('Link Traped');

        request.action = Oxide.NavigationRequest.ActionReject
        Qt.openUrlExternally(url)
        return

    }

    onNavigationRequested: navigationRequestedDelegate(request)
}
Download as text