admin管理员组

文章数量:1287593

I would like to inject an external javascript code into a certain webpage in a mobile phone browser such as chrome or opera mini. On puters, we can do this directly in the console or through extensions such as Scripty. Unfortunately, phone browsers don't show consoles nor do they have extensions. Please how can I achieve this?

I would like to inject an external javascript code into a certain webpage in a mobile phone browser such as chrome or opera mini. On puters, we can do this directly in the console or through extensions such as Scripty. Unfortunately, phone browsers don't show consoles nor do they have extensions. Please how can I achieve this?

Share Improve this question asked Dec 26, 2021 at 11:07 Mich25educMich25educ 3333 silver badges17 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 5

You can use eruda. It's a console for mobile browsers. It also has many plugins such as eruda-touches which visualizes all current touches and their positions. Personally, I made a bookmark using chrome browser on my phone to implement this console directly in any page when i search for its name. Watch this youtube video for more details.

You can use the address-bar to run javascript in that page.

(Tested in Chrome)

Like this:

Since all the codes will be in one line, make sure you use semicolons properly.

If you are using android, then you can use chrome inspect to access console on phone browser using a puter.

  1. First you should connect your phone to your puter via USB and authorize it.
  2. In Chrome on your puter open the following link chrome://inspect
  3. There you can see opened tabs on your mobile device, and open their console.

本文标签: How to inject external javascript code in phone browserStack Overflow