{"id":3356,"date":"2014-03-23T11:23:11","date_gmt":"2014-03-23T11:23:11","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/23\/chrome-extension-create-tab-from-within-an-iframe-in-popup-collection-of-common-programming-errors\/"},"modified":"2014-03-23T11:23:11","modified_gmt":"2014-03-23T11:23:11","slug":"chrome-extension-create-tab-from-within-an-iframe-in-popup-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/23\/chrome-extension-create-tab-from-within-an-iframe-in-popup-collection-of-common-programming-errors\/","title":{"rendered":"Chrome extension: create tab from within an iframe in popup-Collection of common programming errors"},"content":{"rendered":"<p>Your code is working without any changes, I have added working code as a reference; Where is your target source html page of <code>iframe<\/code>, how did you reference it from browser action popup.? If this did not solve share how did you refer your <code>iframe<\/code> from browser action popup.<\/p>\n<h3>manifest.json<\/h3>\n<p>Simple code, registered <code>browser action<\/code>.<\/p>\n<pre><code>{\n    \"name\": \"Iframe Holder\",\n    \"description\": \"http:\/\/stackoverflow.com\/questions\/14429598\/chrome-extension-create-tab-from-within-an-iframe-in-popup\",\n    \"version\": \"1\",\n    \"manifest_version\": 2,\n    \"browser_action\": {\n        \"default_popup\": \"popup.html\",\n        \"default_title\": \"Iframe.\"\n    }\n}\n<\/code><\/pre>\n<h3>popup.html<\/h3>\n<p>Included destination page in <code>popup<\/code> of browser action.<\/p>\n<pre><code>\n\n    \n        \n    \n\n\n<\/code><\/pre>\n<h3>iframe.html<\/h3>\n<p>Used your code and eliminated not related css files etc<\/p>\n<pre><code>\n\n\n    \n        \n        \n        \n    \n\n    \n        \n            \n        \n    \n\n\n<\/code><\/pre>\n<h3>iframe.js<\/h3>\n<p>Used your code with no modifications<\/p>\n<pre><code>$(document).on(\"click\", '.new_tab_bt', function () {\n    openNewTab();\n});\n\nfunction openNewTab() {\n    chrome.tabs.create({\n        url: \"https:\/\/www.google.com\"\n    });\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Your code is working without any changes, I have added working code as a reference; Where is your target source html page of iframe, how did you reference it from browser action popup.? If this did not solve share how did you refer your iframe from browser action popup. manifest.json Simple code, registered browser action. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3356","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3356"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3356\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}