Get Tab based history of urls in Chrome Extension APi - google-chrome

I want to get the history based on tabs not the global history.
I have tried the chrome.history but it is a global history API and it is not giving the tab specific history
Following the thread I checked chrome.webNavigation API but it was just giving the frames of that particular page not the history.
So what is the better way for achieving this?

The history API you're referring is the browser history API.
However, you're looking for the browser session history API (session meaning per-tab).
Since this is a DOM-based API, you can only access this via content scripts. This cannot be used directly from service workers or background scripts, but of course you can use messaging if needed to indirectly access this.

Related

Improve permission warning for chrome.webNavigation

When using chrome.webNavigation the webNavigation permission is needed. As stated on Permission Warnings, using that permission makes the installer to show the warning message:
Read your browsing history
In my case, I only want to listen to one specific domain, let's say domain.com. So, I need to filter the callback for chrome.webNavigation.onCompleted.addListener().
Now, from the user perspective, they could distrust the chrome extension since "Read your browsing history" is too broad and the extension should only work on domain.com.
When a match pattern is used in the permissions, a message like Read and change your data on all domain.com sites and www.domain.com is used.
Is there any other way to use chrome.webNavigation and only listen to one domain? where chrome extension issues/feature requests should be sent?
Update: I had to use webNavigation in order to support AJAX calls. That is, listen to changes in the DOM and the URL made with AJAX. I solved this particular case by using a MutationObserver. Thus, I could remove the permission. The original question was already reported as a bug by Rob W.
In this case, I've already posted a feature request over a year ago: https://crbug.com/431108 ("Allow extensions to use webNavigation API without webNavigation permission").
where chrome extension issues/feature requests should be sent?
Report feature requests and bugs at https://crbug.com/new (points to https://bugs.chromium.org).
If you want to get the equivalent effect of chrome.webNavigation.onCompleted without using the webNavigation API or adding extra permissions, then you can declare a content script and send a message to the background page when the window.onload event fires.

Track new users source - Chrome Store extension

I have a new extension that I am trying to get more users for, I am running two campaigns - lets call them A and B
These campaigns eventually lead to my extension's page on the Chrome store.
Is there a way to know how much installs\addons did each campaign added?
Not clicks - Proper users that added the extension.
Thanks!
In theory, yes.
If you have enabled Google Analytics for your extensions (created a property and added it while editing the extension), that property will start tracking your Web Store page. If you haven't installed it, then no, no such refined data will be available.
You will see installs as visits to /track_install/* URLs. You can create a Goal to have better analytics for it, but you can probably dig through the data even without it.

How can i share a wirecloud marketplace between users

I built some widgets and uploaded on my local marketplace, is there a way to share that?
And better is it possible to share a Mashup (the widget composition) without giving the
possibility to wiring to the user?
I mean the user should use an application layout without change anything.
You can make public your workspaces/dashboards following the steps documented in the user guide. Only the owner of a workspace will be able to modify it. I think this is what are you searching for.
Another option is to create a packaged mashup using the "Upload to my resources" option in the editor view:
Take a look to the "Advanced" tab, where you can block widgets (make them unremovable), block connections (make wiring connections unremovable) and embed used widgets/operator (by default packaged mashups depends on the user having installed all the required widgets/operators. This way you can distribute the widgets and operators used by the mashup in the same package).
However, take into account that this method is meant for sharing mashup templates, the user will always be able to add additional widgets and create new connections in the wiring view.
Once packaged, mashups/dashboards (and widgets and operators) can be uploaded to a WStore server (e.g. to the Store portal provided on FIWARE Lab) for sharing them with other users. The steps for making this is also described in the WireCloud's user guide.
I have the problem, revisited.
I have set up a working Marketplace instance (v2.3) but am unable to integrate it with Wirecloud. The marketplace is correctly registered but all the requests i am making to this Marketplace are throwing 502 error, even though i am actually able to see some results when querying the Marketplace server through a browser.
Indicatively, i can issue a GET command at http://:8080/FiwareMarketplace/v1/registration/stores/ and get an answer, but Wirecloud's internal APIs return a 502 (Bad Gateway).
Any idea on what might have gone wrong?
PS: This happens for WC v0.6.5. When upgrading to a newer (Beta) version of WC, everything seems to be performing as expected, i.e. the marketplace is correctly inserted and the stores are correctly retrieved and processed.

How can we add a file to a user's files.list via the sdk?

We are having issues where sometimes a file that a user can access is not returned when the user issues a files.list. This can happen in many ways. For example, new members of a Google group will not see previously shared files, as described in this question. Moreover, acording to Google documentation there are other limits on sharing which can prevent shared files from appearing in the "Shared with me" view. Finally, a user can issue a files.delete on a file she doesn't own, and the file will disappear from files.list but will still exist.
What can a user do via the SDK alone to cause a file which she can access via files.get to appear in the list of files retrieved via files.list? We are using a service account which impersonates users; the user never authenticates to Google via a browser. A link in an email that the user needs to click won't work for us, unfortunately. Accessing the file via the Google Drive UI has the desired effect, but the analogous files.get call does not.
The Google Calendar API explicitly exposes a CalendarList interface where a user can issue an insert to add an existing calendar to her list. The Google Drive SDK seems like a hybrid Files/FilesList interface with some of the functionality missing (nothing like FilesList.insert) and some of the functionality mixed together (issuing a delete as a non-owner acts like FilesList.delete but issuing it as the owner acts like Files.delete).
If we can't manage the user's files list programmatically then it is not useful for our service. We could ignore the files.list call entirely and just start recursively performing children.list queries on all shared folders, but this is incredibly expensive (unless someone knows how to issue a single query which returns all the Files resources in a folder and not just the IDs of those resources).
Any help would be appreciated. We've been trying this many different ways and have been frustrated at every turn. Thanks!

How can I pass messages between two instances of *the same* Google Chrome extension?

While Google Chrome's messaging API allows communication between two different extensions using their 'Extension ID', I'm yet to see the issue of communication between two instances of the same extension be addressed. Is this possible using the current Google Chrome API? Is there an 'Instance ID' to uniquely identify each instance of my extension?
If not, I think I will try using my own server be the -middle man- and let all the instances of my extension talk to each other using my -middle man-. In that case, does the Chrome API expose the Instance ID for extensions? If not, any advice on coming up with my own Instance ID scheme?
you can certainly do that, I have done the same thing for my Reload All Tabs extension.
https://chrome.google.com/extensions/detail/bfenodnbilondijnaionekngdhadmegk
Basically, you would need an "extension ID" what I did, I basically uploaded the main extension to the gallery, which gave me the unique ID.
With that ID, you can send requests to that extension via:
http://code.google.com/chrome/extensions/extension.html#method-sendRequest
And listen through external extension requests through:
http://code.google.com/chrome/extensions/extension.html#event-onRequestExternal
You can take a look at the source code for Reload All Tabs, to see how it is done:
https://github.com/mohamedmansour/reload-all-tabs-extension