{"id":3162,"date":"2023-07-05T17:27:16","date_gmt":"2023-07-05T09:27:16","guid":{"rendered":"https:\/\/www.vmlogin.us\/help\/?p=3162"},"modified":"2023-08-14T13:06:12","modified_gmt":"2023-08-14T05:06:12","slug":"switch-tab","status":"publish","type":"post","link":"https:\/\/www.vmlogin.us\/help\/api\/switch-tab.html","title":{"rendered":"API Switch TAB"},"content":{"rendered":"\n<p class=\"has-medium-font-size\"><strong>Switch Tab using the API:<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">1. First open the browser using the <strong><a rel=\"noreferrer noopener\" href=\"https:\/\/www.vmlogin.us\/help\/api\/start-browser-profile.html\" data-type=\"URL\" data-id=\"https:\/\/www.vmlogin.us\/help\/api\/start-browser-profile.html\" target=\"_blank\">profile\/start<\/a><\/strong> interface.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"513\" src=\"https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-1.png\" alt=\"\" class=\"wp-image-3163\" srcset=\"https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-1.png 866w, https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-1-300x178.png 300w, https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-1-768x455.png 768w\" sizes=\"auto, (max-width: 866px) 100vw, 866px\" \/><\/figure>\n\n\n\n<p><br><\/p>\n\n\n\n<p class=\"has-medium-font-size\">2. Check the Tab ID based on the address and interface spliced\/json returned by <strong><a href=\"https:\/\/www.vmlogin.us\/help\/api\/start-browser-profile.html\" target=\"_blank\" rel=\"noreferrer noopener\">profile\/start<\/a><\/strong>.<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Eg. <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">http:\/\/127.0.0.1:18500\/json<\/mark><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"654\" src=\"https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-2.png\" alt=\"\" class=\"wp-image-3164\" srcset=\"https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-2.png 868w, https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-2-300x226.png 300w, https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-2-768x579.png 768w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/figure>\n\n\n\n<p><br><\/p>\n\n\n\n<p class=\"has-medium-font-size\">3. Switch Tab:<\/p>\n\n\n\n<p class=\"has-medium-font-size\">Request Url:<\/p>\n\n\n\n<pre class=\"wp-block-code has-medium-font-size\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">http:\/\/127.0.0.1:35000\/api\/v1\/profile\/page\/bringToFront<\/mark><\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\">Request Type: GET<\/p>\n\n\n\n<figure class=\"wp-block-table has-medium-font-size\"><table><tbody><tr><td><strong><strong>Name<\/strong><\/strong><\/td><td><strong><strong>Type<\/strong><\/strong><\/td><td><strong><strong>Description<\/strong><\/strong><\/td><td><strong>required<\/strong><\/td><\/tr><tr><td>profileId<\/td><td>string<\/td><td>Browser profile ID<\/td><td>true<\/td><\/tr><tr><td>id<\/td><td>string<\/td><td>The address and port (value) returned by the&nbsp;<code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\/profile\/start<\/mark><\/code>&nbsp;are spliced with \/json. <br>(Eg. the id field in the tab list (json) returned by&nbsp;<code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">http:\/\/127.0.0.1:18500\/json<\/mark><\/code>)<\/td><td>true<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">Body<br>x-www-form-urlencoded<\/p>\n\n\n\n<pre class=\"wp-block-code has-medium-font-size\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">{\n    \"profileId\": \"2B8EC47C-FF41-4629-8135-E040DDFEE862a\",\n    \"id\": \"9160D076D782A65125C4AD1B014B1B23\"\n}<\/mark><\/code><\/pre>\n\n\n\n<p><br><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Note:<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\">(1) When using the local interface, you need to Enable browser automation settings on the VMLogin client and save the settings. Please refer to the tutorial&nbsp;<strong><a href=\"https:\/\/www.vmlogin.us\/help\/api\/browser-automation-interface.html\" target=\"_blank\" rel=\"noreferrer noopener\">\"Launch the browser automation port\"<\/a><\/strong>;<\/p>\n\n\n\n<p class=\"has-medium-font-size\">(2) For profiled, please refer to the tutorial&nbsp;<strong><a rel=\"noreferrer noopener\" href=\"https:\/\/www.vmlogin.us\/help\/api\/where-is-profile-id.html\" target=\"_blank\">\"Where is the profile ID\"<\/a><\/strong> or use the&nbsp;<strong><a href=\"https:\/\/www.vmlogin.us\/help\/api\/get-list-of-available-browser-profile.html\">profile\/list interface<\/a><\/strong>&nbsp;to get all profileId.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"886\" height=\"517\" src=\"https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-3.png\" alt=\"\" class=\"wp-image-3165\" srcset=\"https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-3.png 886w, https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-3-300x175.png 300w, https:\/\/www.vmlogin.us\/help\/wp-content\/uploads\/2023\/07\/11-3-768x448.png 768w\" sizes=\"auto, (max-width: 886px) 100vw, 886px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Switch Tab using the API: 1. First open the browser usi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-3162","post","type-post","status-publish","format-standard","hentry","category-api"],"_links":{"self":[{"href":"https:\/\/www.vmlogin.us\/help\/wp-json\/wp\/v2\/posts\/3162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vmlogin.us\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vmlogin.us\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vmlogin.us\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vmlogin.us\/help\/wp-json\/wp\/v2\/comments?post=3162"}],"version-history":[{"count":7,"href":"https:\/\/www.vmlogin.us\/help\/wp-json\/wp\/v2\/posts\/3162\/revisions"}],"predecessor-version":[{"id":3431,"href":"https:\/\/www.vmlogin.us\/help\/wp-json\/wp\/v2\/posts\/3162\/revisions\/3431"}],"wp:attachment":[{"href":"https:\/\/www.vmlogin.us\/help\/wp-json\/wp\/v2\/media?parent=3162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vmlogin.us\/help\/wp-json\/wp\/v2\/categories?post=3162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vmlogin.us\/help\/wp-json\/wp\/v2\/tags?post=3162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}