{"id":347,"date":"2012-07-24T02:11:50","date_gmt":"2012-07-24T02:11:50","guid":{"rendered":"http:\/\/garysieling.com\/blog\/?p=347"},"modified":"2012-07-24T02:11:50","modified_gmt":"2012-07-24T02:11:50","slug":"how-to-find-the-url-of-the-current-tab-in-a-chrome-extension","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/how-to-find-the-url-of-the-current-tab-in-a-chrome-extension\/","title":{"rendered":"How to find the URL of the current tab in a Chrome extension"},"content":{"rendered":"<p>It&#8217;s a little hard to find &#8211; getCurrent() returns the current hidden page for the extension.<\/p>\n<pre lang=\"javascript\">\nchrome.tabs.getSelected(null, function(tab){\n   var baseUrl = tab.url;\n   console.log(baseUrl);\n});\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s a little hard to find &#8211; getCurrent() returns the current hidden page for the extension. chrome.tabs.getSelected(null, function(tab){ var baseUrl = tab.url; console.log(baseUrl); });<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[111,302],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/347"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=347"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/347\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}