Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0966919942 for ; Tue, 26 Apr 2016 07:48:47 +0000 (UTC) Received: (qmail 38094 invoked by uid 500); 26 Apr 2016 07:48:47 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 38082 invoked by uid 500); 26 Apr 2016 07:48:47 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 38073 invoked by uid 99); 26 Apr 2016 07:48:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Apr 2016 07:48:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B10A0DFF8A; Tue, 26 Apr 2016 07:48:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: alsorokin@apache.org To: commits@cordova.apache.org Message-Id: <1fe6dd3335ce4899af14500edee28cc5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cordova-medic git commit: CB-11140 Patch CSP tag to allow Appium to execute async scripts Date: Tue, 26 Apr 2016 07:48:46 +0000 (UTC) Repository: cordova-medic Updated Branches: refs/heads/master 163c89d9e -> 2dcba6aa4 CB-11140 Patch CSP tag to allow Appium to execute async scripts Project: http://git-wip-us.apache.org/repos/asf/cordova-medic/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-medic/commit/2dcba6aa Tree: http://git-wip-us.apache.org/repos/asf/cordova-medic/tree/2dcba6aa Diff: http://git-wip-us.apache.org/repos/asf/cordova-medic/diff/2dcba6aa Branch: refs/heads/master Commit: 2dcba6aa42c17310b7c4d43924fbed9c07d01239 Parents: 163c89d Author: Alexander Sorokin Authored: Fri Apr 22 18:50:07 2016 +0300 Committer: Alexander Sorokin Committed: Tue Apr 26 10:48:29 2016 +0300 ---------------------------------------------------------------------- medic/medic-appium.js | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/2dcba6aa/medic/medic-appium.js ---------------------------------------------------------------------- diff --git a/medic/medic-appium.js b/medic/medic-appium.js index dd7df25..64f034a 100644 --- a/medic/medic-appium.js +++ b/medic/medic-appium.js @@ -240,6 +240,41 @@ function parseElementtreeSync(filename) { return new elementTree.ElementTree(elementTree.XML(contents)); } +function addCspSource(appPath, directive, source) { + var cspInclFile = path.join(appPath, "www/csp-incl.js"); + var indexFile = path.join(appPath, "www/index.html"); + var cspFile = fs.existsSync(cspInclFile) ? cspInclFile : indexFile; + var cspContent = fs.readFileSync(cspFile, util.DEFAULT_ENCODING); + var cspTagOpening = "