te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>how to open mobile chrome browser with javascript or html - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

how to open mobile chrome browser with javascript or html - Stack Overflow

programmeradmin4浏览0评论

I have two questions.

//// I want this ////

I want to open chrome browser with url on other android mobile webapp(ex naver, firefox, etc...) with using javascript or html

so example) if user click MysiteButton on mobile web app, then open android device mobile chrome browser with redirect url(on chrome).

what should i do.

//// Question List ////

  1. i found that I should use deeplink or intent but i don't know android mobile chromebrower's intent url or Scheme url. what is android mobile chromebrower's intent url. how to get. ( i used window.location.href = "market://detail?id=.android.chrome"; but not worked)

  2. when i use deeplink or intent, how to redirect url on chrome at the same time open chrome

I have two questions.

//// I want this ////

I want to open chrome browser with url on other android mobile webapp(ex naver, firefox, etc...) with using javascript or html

so example) if user click MysiteButton on mobile web app, then open android device mobile chrome browser with redirect url(on chrome).

what should i do.

//// Question List ////

  1. i found that I should use deeplink or intent but i don't know android mobile chromebrower's intent url or Scheme url. what is android mobile chromebrower's intent url. how to get. ( i used window.location.href = "market://detail?id=.android.chrome"; but not worked)

  2. when i use deeplink or intent, how to redirect url on chrome at the same time open chrome

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Sep 20, 2016 at 19:28 minsu leeminsu lee 411 gold badge1 silver badge5 bronze badges 5
  • 1 Duplicate question, check this stackoverflow./a/29673757/3424327 – Oh hi Mark Commented Sep 20, 2016 at 19:35
  • thank you answer. but maybe it is different. I want open anroid chrome brower from other browers(ex firebox brower not my build app) with javascript or html ( if click my homepage button ) – minsu lee Commented Sep 20, 2016 at 19:45
  • Web apps that run in browsers ie Firefox/Chrome are sandboxed and do not interact with the system. You can't open for example your camera through a browser. The only way as far as I know to open chrome is to be the default browser. – Oh hi Mark Commented Sep 20, 2016 at 20:07
  • thank you! i resolve that other way – minsu lee Commented Sep 20, 2016 at 20:36
  • 2 @minsulee please tell us how You did. I need it too – Marciel Fonseca Commented Nov 9, 2018 at 16:42
Add a ment  | 

3 Answers 3

Reset to default 7

For Android:

<a href="intent:https://yourwebsite.#Intent;end" target="_blank">Open Browser</a>

Note: This solution will open default browser (if its set, if no default browser set, it will show list of browsers which supports opening url)

Make sure that, the click is generated by user (Not Javascript) to test this. Some browsers wont open if its NOT called by user.

I was looking for the answer too as I've tried to send my users from unsupported browsers (for ex: Facebook browser) to chrome.

Unfortunately, John's solution didn't work for me but it pointed in the right direction.

What works for me:

<a href="intent://mysite.#Intent;scheme=https;package=.android.chrome;end">
    Click to open on Chrome
  </a>

Explanation

I've found a good explanation at https://branch.io/glossary/chrome-intents/ , but to sum it up:

Split it to 3 vars:

URI: the name of the site (ex: google.), and notice its without the UriSchemes.

UriSchemes: HTTP / https (you can read more about it at https://www.w3/wiki/UriSchemes)

PACKAGE: the package of the app we want to send the intent to, in our case its .android.chrome

now you can just insert them in the code below

<a href="intent://URI#Intent;scheme=UriSchemes;package=PACKAGE">
    Click to open on Chrome
  </a>

You can try following, It worked for me:

"googlechrome://navigate?url=" + url

i.e. window.open("googlechrome://navigate?url=" + url,"_system"); // here you can try with _system or _blank as per your requirement
发布评论

评论列表(0)

  1. 暂无评论