1

This is my html file for a google chrome extension. It is part of a popup. I have attempted many things, and the images themselves work. When I drag the image on chrome to the new tab bar it opens the link I want, but this doesn't work when clicking.

I attempted to fix this using the base tag, and this allowed clicking the image to send me to the link, however prevented the image loading.

{

"name": "RSS Fetcher",
"version": "0.1",
"manifest_version": 2,
"description": "Keep up with the latest from [insert web site here].",
"icons": {"128" : "sample-128.png"},
"homepage_url": "http://www.youtube.com",

"browser_action": {
"default_icon": "sample-128.png",
"default_title": "Youutube Fetcher",
"default_popup": "Revisionpage.html"
}
}



(html code)
<head>
  <title> Revision resources </title>
</head>

<body>

<a href="http://www.bbc.co.uk/education"> <img src="http://ichef.bbci.co.uk/images/ic/144x144/p03ppzm0.jpg"         width="100px" height="100px" ></a>

<a href = "https://www.youtube.com/channel/UC3yA8nDwraeOfnYfBWun83g">                        <img src = "http://www.tubegeeks.com/wp-content/uploads/2013/05/YouTube-    Education.jpg" width = "100px"  height = "100px" > </a>

</body>  

1 Answers1

0

Anchors will only work from inside an extension popup if the anchors target another window, i.e. by adding target="_blank" to the <a> tags to indicate new windows:

<a href="http://www.bbc.co.uk/education" target="_blank"> <img src="http://ichef.bbci.co.uk/images/ic/144x144/p03ppzm0.jpg"         width="100px" height="100px" ></a>

<a href = "https://www.youtube.com/channel/UC3yA8nDwraeOfnYfBWun83g" target="_blank">   

To open a new tab in the background without closing the popup, you can use the chrome.tabs API as explained here: https://stackoverflow.com/a/8916083/368697

Community
  • 1
  • 1
Ross Allen
  • 43,772
  • 14
  • 97
  • 95