4

当连接到设备并使用 Chrome 开发者工具远程调试时,有没有办法告诉您的设备访问一个新的 URL,而不仅仅是选择一个已经缩略图的页面?

提前致谢,

马丁

4

1 回答 1

3

You can pick one of the pages that are thumbnailed (i.e. one of the open tabs), and in the developer tools for that page, go to the console tab and type:

window.location.href = "http://google.com"

...where you replace http://google.com with your desired URL. (see How to get browser to navigate to URL in Javascript?)

If you don't want to navigate one of the existing pages, one way I know of is via telling android (via ADB) to open a URL, with the default browser set to Chrome in Android. That should open a new tab. See Need command line to start web browser using adb

于 2012-09-15T22:01:53.120 回答