Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to open a new tab from chrome extension popup
    primarykey
    data
    text
    <p>I am new to chrome extension. I have tried the first sample exercise for creating extension. Now I am trying to open an URL in a new tab from the extension popup. Just I have added a HTML anchor tag in the popup.html page.</p> <pre><code>a href="www.google.com"&gt;Click&lt;/a&gt; </code></pre> <p>But its not opening. It is trying to open the URL with following url within the popup itself.</p> <p><em>chrome-extension://ljamgfaclheagbikmcagffcbdbcoodna/www.google.com</em></p> <p>My popup.html has this code.</p> <pre><code>&lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Getting Started Extension's Popup&lt;/title&gt; &lt;style&gt; &lt;/style&gt; &lt;!-- JavaScript and HTML must be in separate files for security. --&gt; &lt;/head&gt; &lt;body&gt; &lt;b&gt;Karthick&lt;/b&gt; &lt;a href="www.google.com"&gt;Click&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And My Manifest.json have the following JSON</p> <pre><code>{ "name": "Test Extension", "version": "1.0", "manifest_version": 2, "description": "The first extension for my test", "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" }, "permissions": [ "tabs" ] } </code></pre> <p>I dont have written anything in popup.js I searched for it how to do it. But they said that I have to use the following.</p> <pre><code>chrome.tabs.getSelected({}, function(tab) { chrome.tabs.update(tab.id, {url: 'http://google.com'}); }); </code></pre> <p>But I don't know the proper way/where to do it. Please tell me the steps to do it. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload