Is there a way to query or modify the history of a single tab with a Chrome Extension? - google-chrome-extension

I'm looking through the Chrome Extension API documentation about chrome.history, and I can't seem to find a way to query or modify the history of a single tab. That is to say, the back/forward menu contents of a tab. Everything in the docs seems to treat Chrome's history as if it was one large amalgam.
So, is there a way to query or modify Chrome history on a tab-by-tab basis? If so, how?

There is not. Jasper's suggestion is valid though, injecting a content script would allow access to the history of the tab.

Related

Retrieve History of a specific Tab in chrome [duplicate]

I am developing a little extensions called "Tab Bundler", which in short saves all the open tabs in a window into a bundle that can be opened with the click of a button. When a bundle is opened however, no history of how the user got to that url is saved, ie. the user can't click back to see how they got to that url. This is functionality I want to implement. I looked for a while, googling, looking thoroughly through the google chrome extension documentation: http://code.google.com/chrome/extensions/history.html. But I couldn't figure out how to get this information without tracking it myself. Is that the only option I have? Any thoughts would be really appreciated.
Thanks!
Look, many people tried this before. You are not alone in this quest!
At the moment the answer in Google Code was: anybody asked for it when they where developing the History API. Then there's no elegant way to access tabs' history.
Of course, you can hook chrome.tabs.onUpdated to record every page and make your own tab's history...
You could probably hook chrome.tab.onUpdate as well as some state or focus change hook to correlate.
I really want this, please make it!

Tab-specific, non-intrusive notification in a chrome extension

I'm developing a chrome extension. When the user goes to the options page, they might modify a setting which will require them to refresh any tabs they have in which they're using the extension. So if the user changes one of these settings, then goes back to a tab which requires a refresh, I'd like to notify them of this in a non-intrusive way.
Is there a part of the API specifically for doing this sort of thing, or some other recommended way of doing it? I was thinking of maybe a little message that comes down from the top of the page, but can be closed, or a popup coming out of the browser action.
You have many options.. To name a few:
Do not require it. As much as you can, make the (presumably) content script adapt to new settings. It's by far a better UX - in some cases.
Least intrusive would probably be to update a browser action / page action icon if you use one.
Both APIs allow a per-tab change of icon/badge. You could also animate it a little to bring attention.
An in-page notification injected into the DOM. Some sort of toast or <dialog>.
Watch tab changes with chrome.tabs events, and do something on activation of affected tab, such as a chrome.notifications notification.

Find specific resource filtering by name - Chrome extension

I'm trying to make an extension that is able to find a specific resource loaded by the page, filtering by name and downloading it. The reason I want to do this is because I usually go to the network tab in the developer tools, filter the requests/responses, for example, looking for one with the word "foobar" in its name, and open the link in a new tab so I can download it (it's an xml file).
I was wondering if this could be automated with an extension, even if the word used to filter is hardcoded.
I don't have any experience with chrome extensions, so I wondered if this could be done or if it's just not possible with the devtools api. In case it could be done, if you could give me some guidelines on how to make it I would really appreciate it.
Thanks!
There are several ways to access the information you need in an extension.
You can write a Dev Tools extension. In that case, you have access to chrome.devtools.network API which will provide you that information.
This requires you to open Dev Tools and interact with your own UI there (such as an extra tab in Dev Tools).
You can go low-level and use chrome.debugger API to attach to a page like Dev Tools would. It's a complex topic, I'm just pointing you in that direction.
Since you rely only on filtering by name, not response itself, you can use chrome.webRequest API to intercept network requests and log those that interest you for processing. This is probably simplest to do.

chrome api: delete omnibox history

I just write my first chrome extension and I try to delete the omnibox history, but it doesn't work.
I use "chrome.history.deleteAll(function(){})" to delete the whole browser history, but there are still old search queries in the omnibox. Is there any other function I have to call?
Regards,
Simon.
Edit: So, I disabled the browser synchronization and used the "browsingData" module, but I still have the same problem. I can't delete all queries and URLs in the omnibox. If I use Ctrl+Shift+Del everything works. Why I don't have the same possibilities with this chrome api?...

Show balloon notification with latest change log entries on update

I would like to display the latest top 3-5 entries of my extension change log (TXT file) when it's auto-updated and ideally in a balloon-type event like the one when you have successfully installed an extension. It should show/popup near the wrench-icon area. Like a replacement for #history that GM scripts have.
There are already a few SO questions about how to get extension version like here.
There are also one here to detect if it's an install or update based on version.
It is not desktop notifications I want.
My question is how to make the balloon and populate it with the lines.
An alternative is open my options.html page in a new tab and show the change log entries there somehow. Requires tabs permission in the manifest.json file.
chrome.tabs.create({url:chrome.extension.getURL('options.html')});
Any ideas how to do this?
Or is this impossible to do?
There's neither a mechanism to create a "balloon" notification (that's reserved for native Chrome code), nor to pop out the popup without user interaction. Your automatic notification methods are fairly limited: creating a new tab with a changelog is certainly possible, but not particularly user-friendly (since it will simply open at some arbitrary time, completely remote from the user's intent).
If possible, I'd suggest waiting to notify the user until she interacts in some way with the extension. Clicking on a page-action, for instance, could have some sort of infobar-like note at the top of the popup's UI inviting the user to read more about the update.

Resources