diff --git a/README.md b/README.md index 1c0d62bcd..bd9a74de1 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,14 @@ Or get the latest APK from the [Releases section](https://github.com/adbenitez/d DeltaLab has some extended support for WebXDC apps: +- `window.webxdc.deltalab` is `true` and can be used by app developers to detect when they can use the DeltaLab-specific features - `sendToChat()`: the file object parameter also accepts a `type` field that can be one of: - * `sticker` - * `image` - * `audio` - * `video` - * `file` (default if `type` field is not present) + * `"sticker"` + * `"image"` + * `"audio"` + * `"video"` + * `"file"` (default if `type` field is not present) +- Inside apps, clicking external links is supported, ex. to open in browser, so you can include links to your website or donation pages. # Credits diff --git a/build.gradle b/build.gradle index 94e01ac51..d2cca4720 100644 --- a/build.gradle +++ b/build.gradle @@ -104,8 +104,8 @@ android { useLibrary 'org.apache.http.legacy' defaultConfig { - versionCode 658 - versionName "1.38.2" + versionCode 659 + versionName "1.38.3" applicationId "com.b44t.messenger" multiDexEnabled true diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt index 224b4584d..9aa156224 100644 --- a/fastlane/metadata/android/en-US/full_description.txt +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -28,4 +28,5 @@ DeltaLab was created with a focus on usability, good user experience, and saving
  • Can open/display mardown (*.md) attachments
  • Can open/display *.htmlzip attachments
  • Can be selected as application when clicking/opening links, this is useful to share the link with web grabber bots
  • +
  • For mini-apps developers: there are some differences in the WebXDC API, check https://github.com/adbenitez/deltalab-android/#webxdc
  • diff --git a/res/raw/webxdc.js b/res/raw/webxdc.js index fbf42d130..3046c87b4 100644 --- a/res/raw/webxdc.js +++ b/res/raw/webxdc.js @@ -16,6 +16,8 @@ window.webxdc = (() => { }; return { + deltalab: true, + selfAddr: InternalJSApi.selfAddr(), selfName: InternalJSApi.selfName(), diff --git a/src/org/thoughtcrime/securesms/WebxdcActivity.java b/src/org/thoughtcrime/securesms/WebxdcActivity.java index 2823851e2..f8f2a3593 100644 --- a/src/org/thoughtcrime/securesms/WebxdcActivity.java +++ b/src/org/thoughtcrime/securesms/WebxdcActivity.java @@ -199,12 +199,11 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE @Override protected boolean openOnlineUrl(String url) { - if (url.startsWith("mailto:")) { - return super.openOnlineUrl(url); + if (url.startsWith(baseURL +"/")) { + // internal page, continue loading in the WebView + return false; } - - Toast.makeText(this, "Please embed needed resources.", Toast.LENGTH_LONG).show(); - return true; // returning `true` causes the WebView to abort loading + return super.openOnlineUrl(url); } @Override