打开Chrome应用程序并注入Javascript
我有一个应用程序可以打开Chrome应用程序,其中有一个特定的url,如下所示:打开Chrome应用程序并注入Javascript,javascript,android,google-chrome,http-live-streaming,Javascript,Android,Google Chrome,Http Live Streaming,我有一个应用程序可以打开Chrome应用程序,其中有一个特定的url,如下所示: Intent intent = new Intent("android.intent.action.MAIN"); intent.setComponent(ComponentName.unflattenFromString("com.android.chrome/com.android.chrome.Main"));
Intent intent = new Intent("android.intent.action.MAIN");
intent.setComponent(ComponentName.unflattenFromString("com.android.chrome/com.android.chrome.Main"));
intent.addCategory("android.intent.category.LAUNCHER");
intent.setData(Uri.parse("http://www.twitch.tv/insomniacgamers12345/hls"));
startActivity(intent);
必须使用Chrome而不是内置浏览器,因为似乎只有Chrome才能正确播放此页面包含的html5视频。这也是我不能使用webview的原因。在Web视图中打开此url将显示“不受支持的播放器”。然而,chrome是有效的
现在,我想将javascript($('video')[0].play()
精确地说)注入我刚刚打开的chrome实例中的页面,以便自动启动视频
这可能吗?我是否可以通过某种方式来计划javascript在即将打开的页面上运行
这可能吗
不可以。欢迎您打开浏览器,但您无法控制现有的浏览器。我想知道用户代理是否不同,您是否可以“欺骗”普通的chrome浏览器?