~ubuntu-branches/ubuntu/wily/unity-webapps-qml/wily-proposed

« back to all changes in this revision

Viewing changes to src/Ubuntu/UnityWebApps/UnityWebAppsUtils.js

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Ken VanDine, Alexandre Abreu
  • Date: 2014-06-26 01:48:37 UTC
  • mfrom: (1.1.33)
  • Revision ID: package-import@ubuntu.com-20140626014837-kdt1gvd2vnxfcrqx
Tags: 0.1+14.10.20140626.1-0ubuntu1
[ Ken VanDine ]
* add content share

[ Alexandre Abreu ]
* add content share

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
    this.webview = webview;
63
63
    this.disposer = disposer;
64
64
    this.makeSignalDisconnecter = makeSignalDisconnecter;
 
65
    this._userScriptInjected = false;
65
66
    this._WEBAPPS_USER_SCRIPT_CONTEXT = "oxide://UnityWebappsApi";
66
67
}
67
68
OxideWebviewAdapter.prototype = {
68
69
    injectUserScripts: function(userScriptUrls) {
 
70
        if (this._userScriptInjected)
 
71
            return;
 
72
 
69
73
        var context = this.webview.context;
70
74
 
71
75
        for (var i = 0; i < userScriptUrls.length; ++i) {
76
80
                    '; matchAllFrames: false; url: "' +  userScriptUrls[i] + '";' + scriptEnd;
77
81
            context.addUserScript(Qt.createQmlObject(statement, this.webview));
78
82
        }
 
83
        this._userScriptInjected = true;
79
84
    },
80
85
    sendToPage: function (message) {
81
86
        this.webview.rootFrame.sendMessageNoReply(