Huang Xin

Results 41 comments of Huang Xin
trafficstars

Just encountered this exact issue several times, you just need to rerun `tauri ios init` and wait the `cocoapods` package updating some Apple dependencies.

In case of any misconfigurations, please ensure that you follow [the prerequisites for iOS](https://v2.tauri.app/start/prerequisites/#ios).

This is my `app.security` in `tauri.conf.json`: ``` "security": { "csp": { "default-src": "'self' 'unsafe-inline' blob: customprotocol: asset: http://asset.localhost ipc: http://ipc.localhost", "img-src": "'self' blob: data: asset: http://asset.localhost", "style-src": "'self' 'unsafe-inline' blob:...

UPDATE: Adding a `access-control-expose-headers: content-range` solves this problem. ![image](https://github.com/user-attachments/assets/e5e107ab-e55b-4047-b345-aca2de2549bf) If there is no security concern about this I will send a PR later after more testing.

According to [MDN on Access-Control-Expose-Headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers), `content-range` is not a `simple response header` and not exposed to client scripts by default in CORS response except that it's listed in the `Access-Control-Expose-Headers`...

We also encountered this in the Readest project, see https://github.com/readest/readest/issues/873. We workaround this with [this](https://github.com/readest/foliate-js/commit/30404a186502cd18cd3924958d5a2a59c27e6993#diff-266bf17878dc9d44c9bc26ba3eb0d28f81d836da25fd2608b86d133590ad03a5R607) and [this](https://github.com/readest/readest/blob/main/apps/readest-app/src/app/reader/hooks/useTextSelector.ts#L125). Still have no clue why this happens. It seems a specific issue on...

Nice catch. I only tested it on Android System WebView and didn't test it on Android Chrome. Indeed the problem still exists on Android Chrome.

> Could you explain your workaround a bit more? It's generally the same workaround like https://github.com/futurepress/epub.js/issues/1366#issuecomment-2026512757. I just canceled the scroll when selecting text on Android.