javascript - Google Chrome Extension Opening Url -


So I'm new to making extensions, so I want to start at a normal one. Well I thought it was not very difficult Was, but I can not open my extensions secretly and open new tab pages in general.

POPUP page:

  & lt;! DOCTYPE HTML Public "- // W3C // DTD XHTML 1.0 Transcription // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Link href = 'style.css' rel = 'stylesheet' type = 'text / css' & gt; & Lt; Script type = "text / javascript" src = "https://www.google.com/jsapi" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Function tab () {chrome.browserAction.onClicked.addListener (function () {chrome.tabs.create ({'url': "http://www.google.com"})}); } & Lt; / Script & gt; & Lt; Base target = "_ blank" & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "google" & gt; & Lt; A href = "google.nl" & gt; Input type = "submit" onClick = "Tabs" class = "btn search-submit" value = "Google" & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Div id = "google" & gt; & Lt; Form action = "websitelink" method = "get" target = "_ blank" & gt; & Lt; Input type = "submit" class = "btn search-submit" value = "website1" & gt; & Lt; / Form & gt; & Lt; / Div & gt; & Lt; Div id = "twitter" & gt; & Lt; Form action = "websitelink" method = "get" target = "_ blank" & gt; & Lt; Input type = "submit" class = "btn search-submit" value = "website2" & gt; & Lt; / Form & gt; & Lt; / Div & gt; & Lt; Div id = "youtube" & gt; & Lt; Form action = "websitelink" method = "get" target = "_ blank" & gt; & Lt; Input type = "submit" class = "btn search-deposit" value = "website3" & gt; & Lt; / Form & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt; My Manifest File:  
  {"name": "My assistant", "version": "1.0", "Description": "My assistant "," "Browser_action": 2, "browser_action": "icon128.png", "default_title": "extension description", "default_popup": "extension.html"}, "permissions": ["tab   

The only thing I am trying to do is open a website on a new tab.

  {"name" Details ":" Tab opens! "," Browser_Actions ": {" default_icon ":" icon128.png "}," icon ": {" 48 ":" icon128.png "}," background ": {" script ": [" background.js "]}}   

background.js < / P>

  chrome.browserAction.onClicked.addListener (function (activeTab) {var newURL = "http://www.google.nl"; chrome.tabs.create ({url: newURL}}) ;});   

background.html

  & lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 & gt; Hello people & lt; / H1> & Lt; Br / & gt; & Lt; P & gt; Hello fellow Pele & lt; / P & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

I hope my answer will help you.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -