{"name": "My new tab page","description": "Overrides Chrome's new tab page with a custom HTML page. Also includes ability to link to Chrome's internal pages.","version": "0.1","incognito": "split","chrome_url_overrides": {"newtab": "index.html"},"background": {"scripts": ["background.js"], "persistent": false},"permissions": [ "tabs" ],"manifest_version": 2}
function openChromeBookmarks() {chrome.tabs.create({url: 'chrome://bookmarks/'});}function openChromeHistory() {chrome.tabs.create({url: 'chrome://history/'});}function openChromeExtensions() {chrome.tabs.create({url: 'chrome://extensions/'});}function openChromeSettings() {chrome.tabs.create({url: 'chrome://settings/'});}
<a href="chrome://history/" onclick="chrome.extension.getBackgroundPage().openChromeHistory()"><img class="iconsm" src="images/history.png" alt="history" /></a>
No other javascript-related code appears in the header of the html file.
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/15b3272b-9783-446b-9a19-add446b4f80c%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/676f87e3-dc05-41ed-af0d-c3d4cc06edbc%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/90d407ba-1a5e-4e12-ad34-dbd35f83a43d%40chromium.org.
<a href="chrome://history/" onclick="chrome.extension.getBackgroundPage().openChromeHistory()">ICON FILE</a>
Is it constructed correctly? Is Chrome rejecting the initial href value, and therefore not reading the onclick value? If so (or if it's something else) how would I fix it?
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/c71dd102-af7f-4e61-8a5a-7250e847e498%40chromium.org.
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsubscribe...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/90d407ba-1a5e-4e12-ad34-dbd35f83a43d%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/c71dd102-af7f-4e61-8a5a-7250e847e498%40chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/6da97751-6ad2-4356-af6f-e57908f9f5da%40chromium.org.
Questions:
And then in my index.html file I should:
- Do I need to duplicate the activating code for each of the pages I want to open? E.g., once for History, another for Settings, etc.)?
- If so, can I use the same linkTag ID for all links, or should I create separate IDs for each type of link (e.g., linkHistory, linkSettings, etc.)
Question:
- Is that new <a> tag sufficient for the HTML page to know that it's a link?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/c71dd102-af7f-4e61-8a5a-7250e847e498%40chromium.org.
--Joe MariniDeveloper Advocate / Chrome Apps, Extensions, Web Store
To post to this group, send email to chromium-...@chromium.org.--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/6da97751-6ad2-4356-af6f-e57908f9f5da%40chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/63e9e715-b4ef-4e13-bf79-39cf20e1c184%40chromium.org.
☆PhistucK
Jeff
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/6da97751-6ad2-4356-af6f-e57908f9f5da%40chromium.org.
--Joe MariniDeveloper Advocate / Chrome Apps, Extensions, Web Store
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/ec3ebbf9-18dd-48e9-9512-9c267e8f9bdc%40chromium.org.
{"name": "New tab page","description": "Overrides Chrome's new tab page with a custom HTML page. Includes ability to link to Chrome's internal pages.",
"version": "0.1","incognito": "split","chrome_url_overrides":{"newtab": "index.html"},"background": {"scripts": ["background.js"],"persistent": false},"permissions": [ "tabs" ],"manifest_version": 2}
Note: I don't have separate ID tags in the html file's header to define these IDs in any way. Is that necessary, or is the call to background.js supposed to handle that?
I don't have experience with javascript. I tried to implement advice from other posters, but I fear that I've just created a mess. Do I need separate document.getElementById code (as well as ID tags) for each function?
function openChromeBookmarks(){ chrome.tabs.create({url: 'chrome://bookmarks/'}); }function openChromeHistory(){ chrome.tabs.create({url: 'chrome://history/'}); }function openChromeExtensions(){ chrome.tabs.create({url: 'chrome://extensions/'}); }function openChromeSettings(){ chrome.tabs.create({url: 'chrome://settings/'}); }
document.getElementById("linkHistory").addEventListener("click", function() {chrome.runtime.getBackgroundPage(function(background) {background.openChromeHistory();});});document.getElementById("linkBookmarks").addEventListener("click", function() {chrome.runtime.getBackgroundPage(function(background) {background.openChromeBookmarks();});});document.getElementById("linkExtensions").addEventListener("click", function() {chrome.runtime.getBackgroundPage(function(background) {background.openChromeExtensions();});});document.getElementById("linkSettings").addEventListener("click", function() {chrome.runtime.getBackgroundPage(function(background) {background.openChromeSettngs();});});
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/d8c9e409-b554-4e13-962d-e1f4b11a899c%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/a6ad6088-44e8-46d6-ba89-58c840db558b%40chromium.org.
Again, this is a general development question, inappropriate in this group.
The hRef attribute should not matter, the event handler will run anyway, whether the hRef is legal, blocked or whatever.You can use "#" as the value. This is what most of the developers do when they need an anchor but have no real use for its hRef.Rob suggested that you move the functions that actually open the pages into the (external) script file of the new tab. That may help you debug stuff and you would not need to call chrome.runtime.getBackgroundPage (which is asynchronous and complicates the flow) or anything, just call the functions that you put in background.js (you can simply add <script src="background.js"></script>) directly.
☆PhistucK
On Thu, Feb 20, 2014 at 5:49 PM, Jeff Cowles <jeff....@gmail.com> wrote:
Thank you very much. Your advice appears to have fixed my error; I no longer receive it.I'm still having trouble with the construction of the links in HTML, however. I need to have an href element so that HTML knows that my icons have links. But what should that href element be? The following.....<a href="chrome://bookmarks" id="linkBookmarks"><img class="iconsm" src="images/bookmarks.png" alt="bookmarks" /></a>
... attempts to open the chrome://bookmarks page immediately (resulting in an error) and never seems to read the ID tag. Any ideas?
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.