I developped an OracleJet app and it works fine on browser and mobile I am using cordova sqlite plugin "cordova-sqlite-storage" to store some data in a sqlite database but after sometime I noticed something very strange the openDatabase method triggers a error "failed to execute 'opendatabase' on 'window' access to the webdatabase api is denied in this context" What I am try:
- Install latest version of chrome (no success).
- Update the windows registry database :“HKEY_LOCAL_MACHINE” > “SOFTWARE” > “Policies” > “Google” > “Chrome“>WebSQLNonSecureContextEnabled to value 1 (enabled) but again (no success)
Script causing error:
self.doRequired = function () {
try {
self.databaseSetting = openDatabase(self.databaseSettingName, "0.1", "Sales list", 3 * 1024 * 1024);//===it gives here the error and run the catch block
} catch (err) {
self.databaseSetting = window.sqlitePlugin.openDatabase({name: self.databaseSettingName + '.db', location: 'default'});//==it gives reading properties of undefined openDatabase because window.sqlitePlugin is undefined
}
return new Promise(function (resolve, reject) {
self.databaseSetting.transaction(function (tx) {
tx.executeSql("create table if not exists setup_table ( serial number , username number , password varchar2(200),mode varchar2(100), connection number , constraint setup_table_key primary key ( serial ))");
}, function (error) {
resolve();
}, function () {
resolve();
});
});
};