Chrome extension History API - tabs

I am writing a chrome extension that needs to analyze the recent browsing history for a particular tab. The chrome.history API allows me to search for items in the global history, but seemingly provides no means to localize the results to a particular tab. Am I missing something, or is this impossible to get?

I think what you are looking is the navigation API. The Chrome history is not related to a particular tab. If you want to use or delete from the history a element of the tab navigation you can use the history search function with the navigation information.

Related

Get Tab based history of urls in Chrome Extension APi

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.

How to clear cookies from single site in Google Chrome version 62

The instructions given for clearing individual cookies at the Google help page at https://support.google.com/chrome/answer/95647?co=GENIE.Platform%3DDesktop&hl=en is incorrect for version 62, it seems.
Under Advanced settings, Privacy and Security, Clear Browsing Data one can only clear ALL cookies back for a period of time specified in the drop down menu. I can't seem to find any way of clearing ALL cookies from a specific site the way it was possible in the past (and the way specified in the help page).
Has this been moved to another place in the Settings interface, or has Google deleted the ability to manage cookies site by site?
The fastest way (at least in Chrome 63) is just to open the following url:
chrome://settings/siteData
Just pick the site you're interested in and you'll see all cookies (or other artifacts like cache, localstorage, etc.).
This is now buried deep in Chrome > Preferences > Advanced > Privacy & Security > Content Settings > Cookies > See all cookies and site data!
Fortunately you can get straight there by typing - chrome://settings/siteData in the address bar.
Once it loads, you can search for & delete individual cookies
Click the "i" next to the domain. There should be the word "Cookies" and under that the text " used". Click that. Now select the first one and spam-click "Remove" until the list is empty.
I Found one more powerful way to delete the site's client-side data. Go to Developer tools(F12) under the application tab, select clear storage.
can clear
Cookies
Cache
Indexed DB
Web SQL
Service Workers
and a lot more.

How can i find a specific word (such as Norway), in a LinkedIn profile. I am trying to find it in inspect

How can i find a specific word (such as Norway), in a LinkedIn profile. I am trying to find it in inspect. I am trying to find all the people that went to Norway, but sometimes it doesnt say in their main summary, but hidden in their full summary.
Any other suggestions, are welcomed.
Thanks.
There's no designated area where people would put where they've been. They could put it anywhere in their profile. You can simply search the page in the Inspector, with Cmd+F (Mac) or Ctrl+F (Windows) shortcuts and keep pressing enter until you find. It's tediuous and there's no guarantee all the content has been loaded at any given time, e.g. requires AJAX requests etc.
However, if you want to get this kind of information in a more structured and automated way, I recommend checking out the LinkedIn API. You can either use the REST API, which requires OAuth, or the JavaScript SDK, which requires an API key. The latter would be my preferred choice.
The API provides a list of basic profile fields you can get back from the JSON response.

browsing history from all signed in devices

Trying to access history across all signed in devices but can only get the history on the current device (in this case the desktop browser).
I created a history replacement extension and have received several bad reviews because users have expected to see all their browsing history in the extension. Chrome's history viewer displays full history from all signed in devices as it says below.
I'm currently using the Sessions API to get all devices' visits in the active sessions in combination w/ the History API to get the current device's complete history, but it's not good enough.
Did I miss something or does this functionality just not exist yet in Chrome's API?
One workaround is to use google search history,
https://history.google.com/history/, which keeps tracks of all of your
searches across all devices and the pages that you have opened
following the searches. However it is not exactly the same.
https://superuser.com/questions/849040/show-history-from-all-devices-in-chrome
When you're signed in to Chrome on different devices, you can choose what information will sync across them -- such as your apps, bookmarks, history, and extensions.
To learn how to customize your sync settings, select your device below:
Computer
In the top-right corner of the browser window, click the Chrome menu Chrome menu .
Select Settings.
Under "Sign in," click the button Advanced sync settings.
In the drop-down menu, select how much information you want to sync. You have two options:
Sync everything: All of the information in the checkboxes will sync.
Choose what to sync: Mark the information you want to sync with checkboxes.

chrome extension: open an website with different account in each tab

I have several accounts for a website and currently I want to write an extension that I can open all the accounts simultaneously in chrome, each tab for one account.
So that means I want each tab with a separate cookie system, is it doable? If so please suggest the API I should use, thanks!
Go to Chrome Preferences. There is a Users section where you can add users. Each new user will have its own cookie jar, so you can log in to a site as many different users at once. It makes new chrome windows, but it seems you cannot drag a tab onto a window of another user.
According to Chrome documentation, you can modify HTTP headers (including cookies) in the onBeforeSendHeaders event handler. So, you need to store new cookies for every account by means of the onHeadersReceived event handler, and then substitute them for every tab in outgoing requests.
There even exists an extension which seems doing almost the thing you want - Chrome Cookie Switcher.
Also I have found an answer that may be helpful for your task: Associate a custom user agent to a specific Google Chrome page/tab.
I really don't think Chrome allows extensions to do this. If I recall correctly, extensions can inspect and block requests, but they can't modify them, such as changing cookies on the fly for each tab.
I suggest you use the --user-data-dir command-line option of Chrome. It allows you to keep several separate profiles, each in its own directory, and then you only need to start chrome with the proper option:
# run this command to use the first profile
google-chrome --user-data-dir=/home/binchen/my_chrome_profiles/my_profile_1
# run this command to use the second profile
google-chrome --user-data-dir=/home/binchen/my_chrome_profiles/my_profile_2
...
Each profile will be in its own Chrome window, with its own cookie store, instead of its own tab, but it's easier than writing an extension.
Lastly, if the website you're mentioning is Google, you can keep several Google accounts open at the same time.