Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6DE710FBF for ; Thu, 19 Sep 2013 14:36:19 +0000 (UTC) Received: (qmail 25317 invoked by uid 500); 19 Sep 2013 14:36:19 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 25295 invoked by uid 500); 19 Sep 2013 14:36:19 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 25287 invoked by uid 99); 19 Sep 2013 14:36:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Sep 2013 14:36:18 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of agrieve@google.com designates 209.85.160.45 as permitted sender) Received: from [209.85.160.45] (HELO mail-pb0-f45.google.com) (209.85.160.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Sep 2013 14:36:12 +0000 Received: by mail-pb0-f45.google.com with SMTP id mc17so8468292pbc.32 for ; Thu, 19 Sep 2013 07:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=ElQJ265Uer3uj87c09xSHq2dzP35MSNX6qCmNBykEsk=; b=n5DiRvudRpOzIuWd/plx/JV25sCmRGcOxSXvkslLi+eMPcQVGF+czO5tXnCc3wH7G5 b9B+J4CzAz210hL3ANG+jWHG2CGfZqt7FhMJBQHf79iYC+0F0USmYoF/1J6WjwwydzDF a6hpi7KpRfH8T/dgADama/7ddHXihcseH7r9MMY7omWU1VeaPsWhPIfcFO4H1cgr9rjG o5JNe3ROPJ7Kpk0LRV4u8QGXFjyenXf8AiZumd1TSfRlkrnUVMAihogZk1UXCCGE2nzP SIJwDHg+mdeCdBCancKFz9+BN1ymTjyNW7XUuVOw0UUKBVDKJJHb59+W4WEHW0mTTV3C knXg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=ElQJ265Uer3uj87c09xSHq2dzP35MSNX6qCmNBykEsk=; b=Kt1T1QfwflHyZgbCNosgnLLnLwb7lCaLcpKyxELzJPQhvmKwiQvpl/FnbWtKxlSOnf 7u4TmW6doU/eBH9um2SPHinMwi7AZV8WMOJc9L43GJHlxdShfzTlIifJXm+zkwDy7BLR 3vYzY8Z4kEpv4sB2lxvEhKHMtjqtwHlG50P6o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:content-type; bh=ElQJ265Uer3uj87c09xSHq2dzP35MSNX6qCmNBykEsk=; b=LhImsT5BLjFw55d1yoIgNjpZGqwhVS2+Sg3ACGMtkvpI2bmkdmqIIQp0gg2s91VBUl kYRYyf53ZorYGPgsdMRRlUeCI/29jNbkpPg21zkTNLRrdhOdiCo2r04kQl4/C5oWun25 riZq1R/QHbNeav1fQgUZ4F13LxNEoYKfFfq6JKrNJwF8m164xpPqm3jgGRYgtZ/VvIR8 5aYz5CDvQuU+LwoXYOYulX0tEriHu0qN+IF5LEnKYK2NxkMJu0AeQghN0Q4psUec2hwO hIV7RliUjGBHGXzoVmP1w48ejmR5KzxH3KBwJUBlZe57zxlfO70F/qheR36ZEHODaD9g aMCg== X-Gm-Message-State: ALoCoQk/pqCaiJjrhvzTvggXlAw4sHuL86mupzW8m4WyLorSw9rLNERPoGL6DQYonfSmZ7jLvccyxdci5LHvTL5oi3kND6E3AHMgw+cGiz3pHrAstQbHjidSLMPk7HTafqqawpoHSWmJwO01nUo+mj+mwo0sFLkZYfotnd+BBj5rUBLcIDaHIbJWo/ZZgLFdSsO5JOlU5BGw/1yQHcQPfV7v5KgXIFlObQ== X-Received: by 10.66.219.41 with SMTP id pl9mr2548003pac.187.1379601350677; Thu, 19 Sep 2013 07:35:50 -0700 (PDT) MIME-Version: 1.0 Sender: agrieve@google.com Received: by 10.68.17.98 with HTTP; Thu, 19 Sep 2013 07:35:30 -0700 (PDT) In-Reply-To: <523aacc7.6cf5420a.4bd5.0ba4@mx.google.com> References: <523aacc7.6cf5420a.4bd5.0ba4@mx.google.com> From: Andrew Grieve Date: Thu, 19 Sep 2013 10:35:30 -0400 X-Google-Sender-Auth: w4obGKMjpW0fvmPTq-pCqxmhMGs Message-ID: Subject: Re: [Android] WebView, InAppBrowser and UI Threads To: dev Content-Type: multipart/alternative; boundary=047d7b5da81f70809a04e6bd786e X-Virus-Checked: Checked by ClamAV on apache.org --047d7b5da81f70809a04e6bd786e Content-Type: text/plain; charset=ISO-8859-1 On Thu, Sep 19, 2013 at 3:50 AM, purplecabbage wrote: > Why don't we make relative urls a developer concern? The developer should > know their own package, and it can be easily resolved using current > window.location and expected location of the file. > URLs are such a core piece of web APIs, that I think it would be quite bad if we didn't properly support them (plus it's quite easy to do). > > A minor rant, while we are on the subject of iab: > > I don't understand why this executeScript madness was added. Why not just > call for a new URL with a javascript:prefix ? > If you want a full blown web-browser control then make a new plugin, iab > (originally ChildBrowser) was intended to show potentially unsafe code > inside your app without risk. The API is already non-standard, and worse > still it mimics a standard api but mutated. There are probably security > implications to all of these choices as well. > Native app WebView controls can inject JS, so why would we make ours less powerful? > > What is the use-case for insertCSS? Is it to load someone else's html with > your style sheet? > That would be my guess. > > Sent from my iPhone > > > On Sep 18, 2013, at 7:31 PM, Andrew Grieve wrote: > > > > I assigned it to David just because I thought it would be a good bug for > > him and thought it sounded important to fix. I don't think he's in any > > hurry to get to it, so feel free to assign it to yourself. I don't really > > consider bugs to be actually assigned when they are assigned to the > default > > person since it's not clear that anyone's looked at it. Maybe it'd be > worth > > having new bugs come in as "unassigned", so that when someone assigns it, > > it's more meaningful. I'll start another thread to discuss this idea. > > > > Anyways, I've thought a good amount about this problem previously (what > to > > do with relative URLs), and I think the best solution is to resolve > > relative URLs in JS. iOS also has no good way of resolving relative URLs > > from native. I added a function to do just that in this release - > > require('cordova/urlutil').makeAbsolute(url) > > > > I'll make a note of this on the bug. > > > > > >> On Wed, Sep 18, 2013 at 5:21 PM, Joe Bowser wrote: > >> > >> I'm currently trying to figure out CB-4858, which got assigned to > >> David, but I'm finding that I'm getting stuck at this part: > >> > >> > >> private String updateUrl(String url) { > >> Uri newUrl = Uri.parse(url); > >> if (newUrl.isRelative()) { > >> //url = this.webView.getUrl().substring(0, > >> this.webView.getUrl().lastIndexOf("/")+1) + url; > >> } > >> return url; > >> } > >> > >> The problem with this code is that all methods on the WebView class > >> must run on the UI thread. Now, there's no easy way for us to pass > >> this data back because now we're doing asynchronous Java where we have > >> to wait for the UI thread to give us back the URL so we can find out > >> what our base path is. > >> > >> We could override this in CordovaWebView, getting around the check, > >> but I think that this might not be the right thing to do. > >> > >> Anyway, I'm content letting David chew on this, since I didn't know it > >> got assigned to him (JIRA didn't send me the e-mail), but I'd be > >> interested in seeing how this gets solved, because it's particularly > >> ugly. > >> > --047d7b5da81f70809a04e6bd786e--