Can I inject Javascript code into Chrome Custom Tabs

后端 未结 4 903
既然无缘
既然无缘 2021-01-07 19:05

In my app, I am currently using a web view to display some content. Then, I use Javascript injection to quickly fill out the form for the user.

The only issue is, W

4条回答
  •  粉色の甜心
    2021-01-07 19:34

    Chrome prohibits you from doing any of that. If this were allowed then it would be a big security issue since you can modify the page within the app.

    Suppose you have an app that has a facebook sign in. You can use the above method to steal someone's login info. But since injecting javascript isn't allowed we cannot do that.

    With Chrome Custom tabs, you don't have much control over the content that is served. You should probably try an alternative, like passing the first name as a URL parameter and then write a script on that page to read the parameter and fill the form out.

提交回复
热议问题