jasonelle-v2 icon indicating copy to clipboard operation
jasonelle-v2 copied to clipboard

no touch when using local file:// and pull-to-refresh

Open cpg opened this issue 6 years ago • 10 comments

Describe the bug when unsing "$pull": { "type": "$reload" } in an action and the background is an html with url of file://... the app loses touch

Example Jasonette Document URL

{
    "$jason": {
        "head": {
            "title": "Some Title",
            "actions": {
                "$foreground": { "type": "$reload" },
                "$show": { "type": "$render" },
                "$pull": { "type": "$reload" }
            }
        },
        "body": {
            "background": {
                "type": "html",
                "url": "file://index.html",
                "style": { "background": "#111111", "progress": "#fd4f00"  },
                "action": {
                    "type": "$default"
                }
            }
        }
    }
}

for index.html, you can curl -o index.html this

To Reproduce Steps to reproduce the behavior:

  1. set the hello.json to the above
  2. get the index.html in the file/ area
  3. run
  4. try to move around the page or tap

then change the url from index.html to the url. it will allow touch and run just fine

Smartphone (please complete the following information):

  • Device: Pixel
  • OS: Android 6, 7 8, 9, 10

Compilation:

  • master and develop branches

cpg avatar Oct 05 '19 11:10 cpg

In the meanwhile, you can try whitout $pull action, and the touch should work, but, you would't have $pull. Im working on a solution

panterozo avatar Nov 12 '19 03:11 panterozo

Hello, i have similar issue. Have you found solution?

e1sep0 avatar Jun 10 '21 11:06 e1sep0

Ok we will have this issue revised so we can find out why this is happening and if can be solved

clsource avatar Jun 10 '21 20:06 clsource

Thanks a lot) And one more problem but offtop) When i build APK with Webview, i want to use html5 camera on my website. When i test application on usb connected phone through android studio, all is fine, permissions for camera works and camera swithes on. But when i build apk file, download it to my phone and install it, application doesnt require any permissions, and camera doent work, till i manually set permission through phone settings -> applications. How can i switch camera permissions during installing? In AndroidManifest i use 22 SDK version/ Thank you =)

e1sep0 avatar Jun 10 '21 21:06 e1sep0

Please check latest version in develop new permissions were added to the manifest :)

clsource avatar Jun 10 '21 21:06 clsource

No results, unfortunately, i`ve got new develop version, but there are no permissions image In AndroidManifest added rules:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA" />

e1sep0 avatar Jun 11 '21 07:06 e1sep0

I`ve added to JasonAgentService.java:363 rows:

agent.setWebChromeClient(new WebChromeClient() {
                        @Override public void onPermissionRequest(final PermissionRequest request) {
                            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                request.grant(request.getResources());
                            }
                        }

And got error when trying acces to camera:

E/cr_VideoCapture: allocate: manager.openCamera: 
    java.lang.SecurityException: validateClientPermissionsLocked:1066: Caller "com.jasonette" (PID 10229, UID 25387) cannot open camera "1" without camera permission
        at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:747)
        at android.hardware.camera2.CameraManager.openCameraDeviceUserAsync(CameraManager.java:405)
        at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:567)
        at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:495)
        at fQ3.startCaptureMaybeAsync(chromium-Monochrome.aab-stable-443006623:11)
     Caused by: android.os.ServiceSpecificException: validateClientPermissionsLocked:1066: Caller "com.jasonette" (PID 10229, UID 25387) cannot open camera "1" without camera permission (code 1)
        at android.os.Parcel.createException(Parcel.java:1967)
        at android.os.Parcel.readException(Parcel.java:1921)
        at android.os.Parcel.readException(Parcel.java:1871)
        at android.hardware.ICameraService$Stub$Proxy.connectDevice(ICameraService.java:343)
        at android.hardware.camera2.CameraManager.openCameraDeviceUserAsync(CameraManager.java:369)
        at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:567) 
        at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:495) 
        at fQ3.startCaptureMaybeAsync(chromium-Monochrome.aab-stable-443006623:11) 

e1sep0 avatar Jun 11 '21 08:06 e1sep0

I tested with this json on iOS and it seems it needs at least an empty sections property before the backgroundproperty.

I havent tested on Android yet but maybe this would work.


{
    "$jason": {
        "head": {
            "title": "Reload webpage on pull",
            "actions": {
                "$pull": {
                    "type": "$agent.request",
                    "options": {
                        "id": "$webcontainer",
                        "method": "(() => window.location.reload())",
                        "params": []
                    }
                }
            }
        },
        "body": {
            "sections": [{"items": [{}]}],
            "background": {
                "type": "html",
                "url": "file://web.html",
                "action": {
                      "type": "$default"
                }
            }
        }
    }
}

clsource avatar Jun 19 '21 07:06 clsource

I tested with this json on iOS and it seems it needs at least an empty sections property before the backgroundproperty.

I havent tested on Android yet but maybe this would work.

{
    "$jason": {
        "head": {
            "title": "Reload webpage on pull",
            "actions": {
                "$pull": {
                    "type": "$agent.request",
                    "options": {
                        "id": "$webcontainer",
                        "method": "(() => window.location.reload())",
                        "params": []
                    }
                }
            }
        },
        "body": {
            "sections": [{"items": [{}]}],
            "background": {
                "type": "html",
                "url": "file://web.html",
                "action": {
                      "type": "$default"
                }
            }
        }
    }
}

Not working on Android ((

e1sep0 avatar Jul 07 '21 10:07 e1sep0

HAve somebody solved issue ?

e1sep0 avatar Dec 01 '21 10:12 e1sep0