How to update values in chrome cache and auto-fill - google-chrome

number of websites i'm using changed their domain name, and chrome auto-fill suggests links to the URL with the old domain. how can I update all links in chrome's auto-fill / cache?

There is no way to edit existing history items, so your only solution would be removing offending URLs from history.
Sadly, there is currently a nasty bug preventing this from reliably working with extension API if Chrome Sync is used.
In case you happen not to use Chrome Sync, you can write a simple extension to invoke chrome.history.deleteUrl. Otherwise, you'll have to do it manually.

Related

Whitelist a CORS policy for a browser extension?

I have a browser extension which POSTs to a server. I want to whitelist the extension's origin in my server. For instance, requests for the Chrome extension originate from a location like: chrome-extension://fjhbdidbplpijoncnlfoadfadfasdf and from Firefox like: moz-extension://cadf4351-e4f3-ca4d-b974-812309843dafd
I realize that I can whitelist those particular addresses on my server, but I'm not sure if they're static addresses. Do these randomly generated locations ever change, like if I ever submit an update? Is there anyway to set them permanently?
Do those change?
Situation differs for Chrome and Firefox.
Chrome
For released extensions that are on the Web Store, the ID is fixed. You can rely on it.
For unpacked extensions in development, the ID is determined either by the "key" value in the manifest, if present, or the absolute path to the extension folder. So it may change if you move the extension about. But you can "pin" it by providing a valid "key".
Firefox
What you see in Mozilla is an installation-specific origin. No matter what the extension's ID is, the UUID you see here will differ on each extension install (but should persist through updates).
There's some discussion of the mechanism in this bug.
Essentially, this is an anti-extension-blocking technique.
This means you can't whitelist just one origin and be done with it, unfortunately.
Is it a good idea to rely on this?
Probably not. While browsers tend to report Origin faithfully, other tools capable of generating requests don't follow that. So it would be relatively easy to spoof.

chrome extension - will an extension update reset users settings/options page

I built a chrome extension, available in the Chrome Web Store, that has an options/settings page. In the settings, people can add additional webpages to a blacklist (the blacklist is already populated with some websites when the extension is initially installed).
I am now about to release a v2 to the chrome extension (mostly css improvements and an additional feature) and wanted to know, if people have added a bunch of new webpages to their blacklist via settings when using v1, will pushing an update to google cause their settings to be reset (e.g., back to the original blacklist)? The blacklist is held in localStorage.
Thanks
No, it will not reset your settings after an update, localStorage and chrome.storage will be kept.
Btw, you can test updating process by building a crx file. There are plenty of tools which can help you to make build; (oncletom/crx is the good one).

How to set the page settings with puppeteer?

When performing some actions, chrome sometimes requires the user's permission. How can I accept these popups with puppeteer (In my case "Download multiple files")?
I'm afraid that this is currently not-supported and doesn't appear to be in the near future. According to this ticket, it's apparently not an easy task that's going to be taken on soon.
You might look into using xvbf on "headful" Chrome as opposed to using headless as that appears to be the flag that causes Chrome to not use user-settings.

How to delay script/asset loading in Chrome Developer Tools

Is there any way to add a time delay to a script/asset loading in the Google Chrome Browser via the Chrome Developer Tools? Or to block a script loading entirely?
The reason I want to do this is to see how a site performs when a script/asset suffers from delayed loading or failed loading.
In Chrome Developer Tools when you are in the Network you can add custom throttling. You can specify download and upload speed as well as request latency. But this will apply to all resources and not only to a specific one.
--- edit ---
For delay individual URLs on any page, you can use a chrome extension (since it can intercept browser requests). I use https://chrome.google.com/webstore/detail/url-throttler/kpkeghonflnkockcnaegmphgdldfnden
If the asset is a third party or hosted on a different domain, there is a Chrome plugin that's designed to test what you are calling loading delays, that are also called SPOF (Single Point Of Failure). It might not be very intuitive at first use, but it's very helpful :
The plugin is called SPOF-O-Matic and can be found here: https://chrome.google.com/webstore/detail/spof-o-matic/plikhggfbplemddobondkeogomgoodeg
Following solutions have nothing with Chrome Devtools but they work.
If you don't mind redirects then you can try Slowwly or deelay.me.
Other alternative for non-windows OS is Comcast.
You can do it by combining multiple resources.
I use http://www.deelay.me/ to generate the delayed url.
I then combine it with requestly extension (https://requestly.io/) to create a host replace rule to target a specific resource
This devtools extension can fit your requirement, Its a Chrome/Firefox devtools extension that can simulate http request delay for any configurable URL.
Chrome devtools extension webstore
You can use Requestly Browser Extension or Desktop App to modify your network requests. Delaying/Throttling scripts is one of the use-cases amongst many already supported in Requestly.
Here's how you can do it. Once you install Requestly, Use the Delay Request feature.
Create New Rule & Select Delay Rule Type
Define URL (or URL Pattern) and the delay value
This article explains 3 different approaches to add delay/throttle APIs (or network requests). However, in your case Requestly extension based approach should work best.
PS - I built Requestly.

How does the chrome cache work with auto updating extensions?

We are developing a chrome extension that has auto-updating capability.
When the extension is updated automatically, does it force a refresh on the cache for the files in that extension. I.e. what does a user have to do to actually see the changes in the new extension. Is it required that they do a hard refresh to guarantee that they see the latest version of the extension?
Never had any problems with updating, I would say it clears the cache.
Never seen any extension asking you to refresh something or re-enable itself either.