{ "id": "137127", "key": "TIMOB-17754", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-01-08T23:27:59.000+0000", "created": "2014-09-24T19:28:11.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_webview", "qe-manualtest" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" }, { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "issuelinks": [ { "id": "47944", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "148316", "key": "TIMOB-18961", "fields": { "summary": "iOS: Throw an event after each AJAX call inside a webview", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2015-05-29T02:53:09.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\nThe user wants to sync a ecommerce's cart inside a webview with a view showing the number of items in the cart in the app. \r\n\r\nTherefore, he wants to have an event in the webview that throws an event when the cart is updated via AJAX. \r\n\r\nh4. Extra information\r\nWe did some research, and we found some info that could be useful. \r\n\r\nhttp://developer.android.com/reference/android/webkit/WebViewClient.html \r\n\r\nAnd this method\r\n\r\npublic WebResourceResponse shouldInterceptRequest (WebView view, String url) \r\n\r\nStackOverFlow mentioned that method as a way to catch ajax calls:\r\nhttp://stackoverflow.com/questions/3941969/android-intercept-ajax-call-from-webview \r\n\r\n ", "attachment": [], "flagged": false, "summary": "Android: Throw an event after each AJAX call inside a webview", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": null, "closedSprints": [ { "id": 291, "state": "closed", "name": "2015 Sprint 01 SDK", "startDate": "2015-01-03T01:00:00.000Z", "endDate": "2015-01-17T01:00:00.000Z", "completeDate": "2015-01-19T17:24:40.828Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "337629", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/6528\r\n\r\nDo test it out with the site with the AJAX call. \r\n\r\nonLoadResource is available on all Android API level. \r\n\r\nshouldInterceptRequest is only available on API level 11 aka Honeycomb devices. If used on Gingerbread (level 10), it won't be available. \r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n//Replace weblink here with ajax site\r\nvar webview = Titanium.UI.createWebView({url:'http://ajaxtoolbox.com/request/examples.php'});\r\n\r\nwebview.addEventListener('onLoadResource', function(e) {\r\nTi.API.info(\"onLoadResource Event Listener \"+ e.url);\r\n});\r\n\r\nwin.add(webview);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-12-30T02:58:21.000+0000", "updated": "2015-01-08T23:28:16.000+0000" }, { "id": "343484", "author": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "body": "Tested onLoadResource event on WebView.\r\n\r\nTitanium SDK: 4.0.0.v20150205163226\r\nAppc-Studio: 4.0.0.201502111458\r\nTitanium CLI: 3.6.0-dev\r\nAlloy : 1.5.1 GA\r\nOS: OSX 10.10.1\r\nDevice : Galaxy S5 (v4.4.2)", "updateAuthor": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "created": "2015-02-16T06:49:06.000+0000", "updated": "2015-02-16T06:49:06.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }