{ "id": "108083", "key": "TIMOB-12466", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": [], "resolution": null, "resolutiondate": null, "created": "2013-01-18T06:53:28.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "ios", "opendatabase", "webview" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:51.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Summary of issue:\r\n\r\nIf you build a simple Titanium mobile application that contains a WebView which has in it javascript that opens a local database, the first time you install it to an iOS 5.1 device it will open the database correctly. However, if you then upgrade the app on the device (it can still be the exact same version/build), it will error when opening the local database:\r\n\r\nSECURITY_ERR: DOM Exception 18\r\n\r\nSteps to reproduce:\r\n\r\n1. Add the app.js and database.html files below to the root of Resources.\r\n2. Install app to iOS 5.1 device (Run > iOS Device in Ti Studio).\r\n3. Open app, it will say \"db opened\".\r\n4. Upgrade app on iOS 5.1 device (Run > iOS Device in Ti Studio).\r\n5. Open app, it will say \"db opening failed: Error: SECURITY_ERR: DOM Exception 18\".\r\n\r\nHere is the code to reproduce:\r\n\r\napp.js:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({});\r\nvar webView = Ti.UI.createWebView({\r\n\ttop : 0, right : 0, bottom : 0, left : 0, url: 'database.html'\r\n});\r\nwin.add(webView);\r\nwin.open();\r\n{code}\r\n\r\ndatabase.html:\r\n\r\n{code}\r\n\r\n\r\n\t\r\n \tdb test\r\n \t\t\r\n \r\n \r\n \tdb test\r\n \r\n\r\n{code}\r\n\r\nThis issue seems to be the same as Apache Cordova has had and fixed, maybe you can learn something from how they fixed it...\r\n\r\nhttps://issues.apache.org/jira/browse/CB-347\r\n\r\nThis is a serious issue for my company because we have a Sencha Touch app that is integrated into our Titanium app \"hub\" within a webview, so basically we can't support iOS 5 devices without a fix for this.", "attachment": [], "flagged": false, "summary": "iOS: SECURITY_ERR: DOM Exception 18 on iOS 5.1 when upgrading app with WebView that opens local database", "creator": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "environment": "iOS 5.1\r\nTi SDK 2.1.4GA\r\nTi SDK 3.0.0GA", "comment": { "comments": [ { "id": "236197", "author": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "body": "We created a native iOS module that fixes the bug, using the same approach that Cordova implemented. It is very straightforward, I suggest that you guys add this to the standard Titanium WebView ASAP. Source code can be found at the link below:\n\nhttps://bitbucket.org/justintoth/titanium_modules/src/3fa1d1c3f8befbf077145eb8657c87a8b274a7a4/webview/iphone/Classes/TiWebviewModule.m?at=master", "updateAuthor": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-28T15:33:55.000+0000", "updated": "2013-01-28T15:33:55.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }