Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch event listener in injected webview is causing an EOF error #34463

Closed
TadewosBell opened this issue Aug 20, 2022 · 4 comments
Closed

Touch event listener in injected webview is causing an EOF error #34463

TadewosBell opened this issue Aug 20, 2022 · 4 comments
Labels
Component: WebView Related to the WebView component. Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@TadewosBell
Copy link

Description

Hello,
I am attempting to add a touch event listener to a webview using an injected script. Both of these functions are causing an EOF error when touch is detected.

        document.addEventListener("touchstart", function(){
            window.alert("HEY)
          });
            
          
        window.addEventListener("touchstart", function(){
            window.alert("HEY)
          });

I have true at the end of injected script. This is what is causing the issue. anyone know why?

Version

0.69.4

Output of npx react-native info

System:
OS: Windows 10 10.0.19044
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Memory: 2.32 GB / 15.90 GB
Binaries:
Node: 16.5.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.13.2 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowAllTrustedApps: Disabled
IDEs:
Android Studio: Not Found
Visual Studio: Not Found
Languages:
Java: 18.0.2 - C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.4 => 0.69.4
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

add the code posted as string and inject in to webview.

Snack, code example, screenshot, or link to a repository

inject the following code into a webview with an online source.

    `
    try{ 

        document.addEventListener("touchstart", function(){
            window.alert("HEY)
          });
            
          
        window.addEventListener("touchstart", function(){
            window.alert("HEY)
          });
    catch(err) {
        window.alert(err);
    }
    true;
   `
@react-native-bot react-native-bot added the Component: WebView Related to the WebView component. label Aug 20, 2022
@TadewosBell
Copy link
Author

any one have any idea how to get touch feedback from a webview? I need to make a component scrollable when a person presses and holds on the screen.

@TadewosBell
Copy link
Author

fantastic activity from the react native community. Round of applause.

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 30, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: WebView Related to the WebView component. Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants