mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Fix pebble webview local content- and HttpService access.
This commit is contained in:
parent
1af800666e
commit
13064036fe
@ -195,6 +195,10 @@ public class ExternalPebbleJSActivity extends AbstractGBActivity {
|
|||||||
webSettings.setDomStorageEnabled(true);
|
webSettings.setDomStorageEnabled(true);
|
||||||
//needed for localstorage
|
//needed for localstorage
|
||||||
webSettings.setDatabaseEnabled(true);
|
webSettings.setDatabaseEnabled(true);
|
||||||
|
//allow local js files access
|
||||||
|
webSettings.setAllowContentAccess(true);
|
||||||
|
webSettings.setAllowFileAccess(true);
|
||||||
|
webSettings.setAllowFileAccessFromFileURLs(true);
|
||||||
|
|
||||||
JSInterface gbJSInterface = new JSInterface(device, uuid);
|
JSInterface gbJSInterface = new JSInterface(device, uuid);
|
||||||
myWebView.addJavascriptInterface(gbJSInterface, "GBjs");
|
myWebView.addJavascriptInterface(gbJSInterface, "GBjs");
|
||||||
|
@ -108,6 +108,11 @@ public class WebViewSingleton {
|
|||||||
webSettings.setDomStorageEnabled(true);
|
webSettings.setDomStorageEnabled(true);
|
||||||
//needed for localstorage
|
//needed for localstorage
|
||||||
webSettings.setDatabaseEnabled(true);
|
webSettings.setDatabaseEnabled(true);
|
||||||
|
//allow local js files access
|
||||||
|
webSettings.setAllowContentAccess(true);
|
||||||
|
webSettings.setAllowFileAccess(true);
|
||||||
|
webSettings.setAllowFileAccessFromFileURLs(true);
|
||||||
|
webSettings.setAllowUniversalAccessFromFileURLs(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,8 +206,11 @@ public class WebViewSingleton {
|
|||||||
contextWrapper.getPackageManager().getApplicationInfo(internetHelperPkg, 0);
|
contextWrapper.getPackageManager().getApplicationInfo(internetHelperPkg, 0);
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setComponent(new ComponentName(internetHelperPkg, internetHelperCls));
|
intent.setComponent(new ComponentName(internetHelperPkg, internetHelperCls));
|
||||||
contextWrapper.getApplicationContext().bindService(intent, internetHelperConnection, Context.BIND_AUTO_CREATE);
|
|
||||||
internetHelperInstalled = true;
|
internetHelperInstalled = true;
|
||||||
|
|
||||||
|
final Intent intent1 = new Intent("nodomain.freeyourgadget.internethelper.HttpService");
|
||||||
|
intent1.setPackage("nodomain.freeyourgadget.internethelper");
|
||||||
|
contextWrapper.getApplicationContext().bindService(intent1, internetHelperConnection, Context.BIND_AUTO_CREATE);
|
||||||
}
|
}
|
||||||
catch (PackageManager.NameNotFoundException e) {
|
catch (PackageManager.NameNotFoundException e) {
|
||||||
internetHelperInstalled = false;
|
internetHelperInstalled = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user