Disable shortcuts in Google Chrome - google-chrome

Is there a way to disable and replace shortcut commands in Google Chrome. I want to use Chrome for a public computer that only can access one site. Because of this I want to disable keys like Ctrl+Tab, Ctrl+T, Alt+F4 and I want to change F11 to a command like Ctrl+Shift+Alt+J (example) to stop users from exiting full screen mode.
Settings on the network block everything but a specific domain but now I want to block the user from exiting the browser.

I know this question is quite old, but I found a solution that works for me (and probably many others too).
If you don't use the CTRL and ALT keys in the browser at all, you can disable them in the OS itself.
Under Linux, I used xmodmap -pke to find out which key is mapped to which code.
Knowing the keycodes, I used:
xmodmap -e "keycode 37 = "
xmodmap -e "keycode 105 = "
to disable both left and right CTRL keys (to prevent something like CTRL+W, CTRL+T, etc.), then with:
xmodmap -e "keycode 133 = "
xmodmap -e "keycode 134 = "
both left and right SUPER keys (Windows Keys) (to prevent opening the start menu and such fancy stuff)
and then finally with xmodmap -e "keycode 105 = " I disabled the ALT key (to prevent ALT+F4, etc.).
And optionally, we can disable F1 too, so that the Chrome Support Page doesn't open, with: xmodmap -e "keycode 67 = "
Finally, let Chromium or Chrome lock the rest down for us using Kiosk Mode:
chromium-browser --kiosk http://example.com/
or
google-chrome --kiosk http://example.com/
And right click is already disabled in kiosk mode, so we don't need to change anything there.
With all that done, the end user can only navigate with the mouse within the predefined webpage (And links leading to some other content, of course) and write stuff with the normal characters on the keyboard, but nothing more.
Reloading may be still possible (F5), but even that can be disabled with: xmodmap -e "keycode 71 = "
Caution: Please execute xmodmap -pke first to discover if your keyboard or OS have the same keymapping, or you may disable other normal keys without knowing.
Caution 2: Note that if you've done everyhing above and then launch Chrome or Chromium in Kiosk Mode, you can't get out anymore! Only physically pressing the power button or killing the application over SSH or Telnet will let you resume normal operation again.
To make those changes permanent, read the end of this guide:
https://stackoverflow.com/a/11219056/3525780
EDIT: To those who have problems disabling the F1, F5, etc. keys, use following as a workaround:
xmodmap -e "keycode 67 = Escape"
(Somehow those "F keys" need to be assigned to an already existing and assigned key)

Having recently encountered the same kiosk-type problem (and not being able disable all keys in Chrome) I eventually found a solution which I thought I would share:
Using node-webkit I created the following package.json file:
{
"name" : "mykiosk",
"window" : {
"fullscreen" : true,
"toolbar" : false
},
"main" : "http://the-one-and-only-allowed.url/"
}
Launch with: ./nw
All function keys are blocked. Ctrl+N/T do not create tabs. It is quite nice
One last javascript/onload trick to disable the right-click context menu:
window.oncontextmenu = function(ev) {
ev.preventDefault();
ev.stopPropogation();
return false;
}

Chrome has Kiosk Mode, but that won't prevent users from using OS keyboard shortcuts (like ALT+F4, which aren't part of Chrome. Windows handles those). To start it in Kiosk Mode, run it using these parameters:
chrome.exe --kiosk http://www.google.com
My public library actually did something pretty awesome: they installed an extremely minimal Debian build on their kiosks, and run Google Chrome on each one. There are no close buttons, and no desktop to get into, so this deters virtually all the CTRL+ALT+DELETE hackers out there. ALT+F4 doesn't work either, and closing the browser by right-clicking opens up another one instantly.
But they forgot to get rid of GRUB's 10 second timeout, which lets users (well, me) get into recovery mode -_-, so I'm working with them to get that fixed...
I'd seriously consider Linux, as you can install it really quickly on multiple computers and basically forget about viruses and security. But the downside is that there isn't a "Administrator Panel" for you to tweak things with. You'd have to whip out nano (sorry, can't get used to vim) and edit some config files.

For me using version 52.0.2743 the --kiosk tag didn't work, but the --app="http://www.example.com" did what I wanted. (Disabled chrome keyboard shortcuts so I could use shellinabox + nano without issue.)
Also works on Chrome Canary (for which the --kiosk tag also didnt' work).
Other possibly helpful links:
Chrome support how to make a Kiosk App: https://support.google.com/chrome/a/answer/3316168?hl=en
Kiosk App for Chrome: https://chrome.google.com/webstore/detail/kiosk/afhcomalholahplbjhnmahkoekoijban?hl=en

Related

How to enable web security in Chrome after disabling it?

I did the __disable-web-security in Terminal on Mac. Do I need to enable it again? Or does it enable by itself after restart?
If I need to enable it again, how do I do that? I searched everywhere, but didn't find.
Go to chrome://version and look at the Command Line. If the command line argument is still there, you should restart chrome and then launch it normally (without the flag).
A bit more context: "Flag" refers to two slightly different concepts in Chrome:
Any command line argument that starts with a -- (as opposed to an argument that names a URL or a file, for example).
The list of toggles available at chrome://flags.
Any arguments added manually to the command line will only persist until you quit Chrome. On the other hand, the toggles set at chrome://flags will persist until they are reset. (To further blur this, invoking chrome://restart will preserve the command line flags.)
This particular flag makes its presence fairly obvious, with a banner:
You are using an unsupported command-line flag: --disable-web-security. Stability and security will suffer.
So it should hopefully be clear whether the flag is present (and also why this is the sort of flag that can't be persisted at chrome://flags).
The flags set in #2 are delimited in Chrome's command line by the --flags-switches-begin…--flags-switches-end section. Arguments outside of that section are coming from somewhere other than chrome://flags (namely, from the command line, except in the case of Chrome OS and Android, which have their own startup procedures).

Stylish: "Turn all styles off" from command line?

I frequently end up doing ~5 different manual actions when switching between using my laptop in dark environments and light environments, one of which is clicking Turn all styles off in the Stylish extension toolbar button to disable my dark user styles. I'd like to automate this somehow, probably a script bound to a hotkey. Is there a way to have the same effect as clicking Turn all styles off through the command line or some other way to accomplish this goal? I'm using Stylish in Chrome on Ubuntu.
My findings are that there isn't any way to change chrome extension settings from the command line and that the best way to do this is to set a key binding per #wOxxOm's comment and to use xdotool to send the keystrokes to chrome. There are a lot of gotchas in getting this to work. This is the final command I ended up using:
xdotool search --class 'google-chrome' windowactivate --sync \
key --window 0 --clearmodifiers 'ctrl+shift+5'
Chrome doesn't accept the keystrokes if it's not active, so use windowactivate --sync first. It seems that Chrome ignores XTEST events so use --window 0 to force xdotool to use XSendEvent instead. Finally, I had to use --clearmodifiers because I have Caps_Lock and Control_L swapped.

Developer tools getting disabled

I am on Version 45.0.2454.101 m and for some reason dev tools option is getting disabled.
I reinstalled chrome 3 times, no luck.
I tried to delete the registry file based on this answer
Google chrome develop tools disabled
I do not see chromium under policy folder :(.
I searched the user data --> Default --> Preferences folder to see if I can delete the devtools reference, nothing helped :(
Update:
Based on lossleader's comment I checked chrome://policy and I see devtools is disabled, how should i enable or set this to false
Please help
UPDATE : 10/13/2015
My preference file as of today, still dev console is disabled:
10/16/2015 I do not see anything under group policy object too
UPDATE:
I've made a small video with step by step instructions.
1 - Close Chrome
2 - Open the file:
C:\users\[your users account]\AppData\Local\Google\Chrome\User Data\Default\Preferences
3 - SEARCH FOR:
"devtools": {
something...
"disabled": true,
something...
},
4 - CHANGE TO:
"devtools": {
something...
"disabled": false,
something...
},
5 - Restart Chrome.
DISABLED:
ENABLED:
TIPS
1 - If you cannot find "disabled": true, just add the value "disabled": false, under devtools.
2 - You may want to copy the contents of the file to http://jsonlint.com/ in order to read properly.
3 - Backup the Original file (just in case)
4 - I've tested enabling and disabling devtools and it works as expected.
5 - If the problem persists, you may want to disable your extensions in order to ensure they aren't messing with your preferences. The same applies to antivirus.
UPDATE
You said:
notepad ++ complaints saying the source file has been modified by
another program
It doesn't matter, other values may have changed on the file, and that's normal, but the values you've added won't change.
Try deleting this folder:
[user drive]\Users\%user%\AppData\Roaming\Google
which I got from a Superuser question.
Or, do:
Press the Windows key + R, type regedit.exe and press Enter
HKEY_USERS\ -> S-1-5-21-1177238915-1897051121-839522115-1003\ -> Software\ -> Microsoft\ -> Windows\ -> CurrentVersion\ -> Group Policy Objects\ -> {91DD4E7D-FE0F-4B62-A092-91DC1486888E}User\ -> Software\ -> Policies\ -> Google\ -> Chrome
Delete the ones in RED. Click on "Google" and click on "Edit" and select "Delete".
Click on "File" and then "Exit".
Did it work?
If you are logged into Google under a managed account that has the preference off, you'll have to log out to get around it. Other than that the administrator of your account has to change the setting for you to be able to use Dev Tools in Chrome.
This is clearly a Windows box, but you didn't say if it's a personal or work computer.
Looking at the policy in chrome://policy, you will notice that the policy is being set at the "Machine" level.
Read google's documentation here:
Machine Policies are applied through Group Policy Objects (GPO) on Windows..
..(machine policies) are pushed to the user using Windows Group Policy Objects (GPO), Managed Preferences on Mac, or another out-of-band management system for Windows/Mac/Linux..
In other words, it's likely that your workplace has set up a group policy object and is forcing these 3 settings onto your machine. Group Policy Objects generally can't be disabled and often can't even be seen by a non-administrator. Note that when I say "administrator" I'm talking about a domain admin, not a local-machine admin.
The purpose of group policy ("Managed Preferences" on the Mac) is to force certain settings onto a large group of machines. Common examples include password policies, ability to install plug-ins, etc.
It looks like someone in your organization thinks that disabling Chrome's developer tools and incognito mode are good for security. This is kind of a dumb idea, but that's not relevant to the discussion.
EDIT: "that would be highly unlikely but I will look"
You have more confidence in your IT department than I do. :)
Someone probably read this NSA "briefing" and thought it was a good idea.
I don't know how helpful this will be, but are there any other unknown processes running in task manager on your computer. This sounds less like a bug and more like some malware may be forcefully editing any chrome installation. It could also be that when you re-install chrome and sign in some kind of chrome add-on is being loaded which is causing problems.
The only thing that worked for me was changing this value:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\DeveloperToolsDisabled
to 0
Unfortunately, after a logon or some time (I'm no domain admin) the setting is set to 1 again. Thinking about starting Chrome via a batch file and applying the value to the registry key, like this
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome /v DeveloperToolsDisabled /t REG_DWORD /f /d 0
Complete commandline (with UAC):
powershell Start-Process cmd.exe -ArgumentList "/C","'reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome /v DeveloperToolsDisabled /t REG_DWORD /f /d 0'" -Verb runAs
Complete batch file:
REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome" /v "DeveloperToolsDisabled" | Find "0x0"
If %ERRORLEVEL% == 0 goto start_chrome
powershell Start-Process cmd.exe -ArgumentList "/C","'reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome /v DeveloperToolsDisabled /t REG_DWORD /f /d 0'" -Verb runAs
:start_chrome
start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
exit
In the case of Microsoft Edge, I changed the DeveloperToolsAvailability setting value from:
2 (Don't allow using developer Tools)
to
1 (Allow using the developer tools)
Set the Registry Key:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\DeveloperToolsAvailability
And check afterwards:
edge://policy
But since this is work laptop, you at mercy of site admins, when they run group policies. But this worked for me, on laptop where setting is controlled by group policy
Reference: (DeveloperToolsAvailability)
Follow the steps below or refer to these 4 screenshots to enable developer tools.
You will need to be familiar with the Windows registry editor.
Run regedit :Windows key +r then type regedit or search for it
Browse registy to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome
Double click on DeveloperToolsDisbaled
Change the value from 1 to 0
Issue should be resolved
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome:
DeveloperToolsDisabled:
Change Value to 0:
Developer Tools should now be enabled:

Vim: Make chrome refresh anytime I :write

I want a solution that does what's described in the vim wiki here, but that works on Chrome.
That is, I'm trying to avoid this:
Edit your HTML/CSS file.
Hit save in Vim.
CMD/CNTRL/ALT + TAB over to Firefox.
Press Ctrl-R in Firefox to refresh.
CMD/CNTRL/ALT + TAB back to Vim.
Do it again and again, wincing a little bit each time.
The vim wiki solution is for firefox, and other scripts and solutions I've found on the web are Mac only. But I'm on windows, and will often have vim open on the left half of the screen (editing html) and chrome open on the right half of the screen (displaying the file I'm editing).
A really "dumb" solution would work fine for me. That is, there wouldn't even need to be communication of the filename between vim and the browser. If I could just turn on a mode in vim, call it "auto-refresh", and now anytime I do a :w the currently active tab in chrome refreshes itself, without taking focus off the vim window. That would be perfect. Is it possible?
I don't know how to reload a give chrome page from shell, however, I agree with Chiel92 that if you need to see your changes when file changes, you can do that from browser.
See LiveReload, works with Windows & Mac (not for me then) and supports Safari & Chrome.
LiveReload will check your main page as well all css and javscript that it depends from, if any of those changes, it will reload it.
They seems to have launched a second version, however official site of version 2 it's offline and doesn't seem version 2 it's on github either. (Version 1 it's it's on github)
a solution that might work for you is in your html coding include the line in the head tag
<meta http-equiv="refresh" content="30" />
this will reload the page every 30 seconds directly taking from
w3schools.com
now when you want to deploy it just remove that line
If you are working on mac, then a bit of apple script does the job.
putting this function in your vim configuration will let you automate the process of switching between windows and refreshing you described.
function! ReloadBrowser()
silent exe "!osascript -e 'tell app \"Firefox\" to activate\<cr>
\tell app \"System events\"\<cr> keystroke \"r\" using command down\<cr>
\end tell'"
silent exe "!osascript -e 'tell app \"Iterm2\" to activate'"
endfunction
Calling that function will change system focus to Firefox, hit CMD-R to refresh the page, then change focus back to Iterm2.
Change 'Firefox' and 'Iterm2' to fit your workflow.
You can type the function into the vim command prompt like :call ReloadBrowser() or trigger the call with a mapping like this:
nnoremap <leader>rl call ReloadBrowser()<cr>
To trigger the call any time you write the file you could use an autocommand.
augroup AutoReload
au!
autocmd BufWritePost *.filetype call ReloadBrowser()
augroup END
That could get a bit annoying though so if you really want that behavior I think it would be best to make it toggle-able like this:
let s:auto_reload = v:false
function! ToggleAutoReload()
if s:auto_reload
augroup AutoReload
au!
autocmd BufWritePost *.filetype call ReloadBrowser()
augroup END
else
augroup AutoReload
au!
augroup END
endif
let s:auto_reload = !s:auto_reload
endfunction
with that in place you can either manually trigger the reload with <leader>rl or use :call ToggleAutoReload() to enable automatic reloading when you save the file, and a second :call ToggleAutoReload() will disable it when you're done.
I've tried LiveReload in the past but it wasn't a very dependable solution: it was very buggy and unstable and the installation process was too involved for too little effect.
Since then, (more than a year) I've been using a small Chrome extension that automatically reloads the webpage every x seconds. It's not "smart" at all but it works well both for local files and hosted files. I've used it countless times without any side effects whatsoever.
That Solution on the Vim Wiki is possible because of MozREPL which allows an external process to interact with Firefox. From there it's quite trivial to write an autocmd that triggers a refresh on :w or on CursorHold. But AFAIK there's no such tool for Chrome/Chromium and they don't offer an external API. LiveReload is a brilliant but failed hack and I believe that you'll have to settle with the dumb solution if you must work with Chrome.
edit
I just remembered a script that works very well on this Linux box but is a little bit limited on Mac OS X and doesn't seem to work on Windows. Essentially you register a window/tab with a part of it's name:
$ webrf setup-by-search test.html
then you simply do:
$ webrf refresh
to refresh the page.
I use WSL and two screens so for me this works. (as with every :write is a bit too much)
nmap <leader>t :silent !powershell.exe -command "Add-Type -AssemblyName System.Windows.Forms; [Windows.Forms.Cursor]::Position = \"-1290,50\"; Add-Type -MemberDefinition '[DllImport(\"user32.dll\")] public static extern void mouse_event(int flags, int dx, int dy, int cButtons, int info);' -Name U32 -Namespace W; [W.U32]::mouse_event(6,0,0,0,0); [Windows.Forms.Cursor]::Position = \"40,40\"; [W.U32]::mouse_event(6,0,0,0,0);"<CR><CR>
It basicly tells vim through a powershell command to have the mouse cursor go to:
position -1290, 50 ( which is where the refresh button of chrome is)
left mouse click
position 40,40 (which is where my vim is in full screen)
left mouse click
Step 3 and 4 is needed to refocus vim I tried to sent ALT-TAB but my vimrc disliked the % symbol.
On Windows OS you can utilize an AutoHotKey script that will automate that for a key press.
For example, the following script will bind Left Alt + r to switch to the browser window, send a Control + r(Refresh) and then get back to your previous window.
Replace Title_of_your_webpage with your browser's window title string after your page has loaded in it.
!r::
WinGet, winid, , Title_of_your_webpage
WinActivate, ahk_id %winid%
Send ^r
Send !{Tab}
Return

How to delete indexedDB?

I'm working in a project which involves using IndexedDB.
As I'm begining to know this technology, I need to be able to delete an indexedDB by hand so I can start over.
I found the way to do it in Firefox, but I can't find the way for Google Chrome.
I tried deleting the content of this folder (I'm using Mac):
{home}/Library/Application Support/Google/Chrome/Default/IndexedDB
but it seems Chrome stil have the DB anywhere so I can't start over.
I've had success running the following in Chrome:
indexedDB.deleteDatabase('DB NAME')
In theory, all you need to do to delete an IndexedDB in Chrome is:
In Chrome, go to Options > Under the Hood > Content Settings > All cookies and Site Data > find the domain where you created the IndexedDB
Hit either the "X" or click "Indexed Database" > Remove
In Windows, the file is located here:
%USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\IndexedDB
On Mac, do the following:
In Chrome, go to "Settings" (or "Preferences" under the Chrome menu)
Click "show advanced settings" (at the bottom of the page)
Go to "Privacy" > "Content Settings" > "All cookies and Site Data" > find the domain where you created the IndexedDB
Hit either the "X" or click "Indexed Database" > Remove
On Mac, the folder is located here:
/Users/[USERNAME]/Library/Application Support/Google/Chrome/Default/IndexedDB/
On Linux, the folder is located at:
/home/[USERNAME]/.config/google-chrome/Default/IndexedDB/
Alternarive is to do it in the developers console, using this command:
indexedDB.deleteDatabase("databaseName")
In Chrome webkit you can use webkitGetDatabaseNames which returns all database names
With this code, you can delete all local indexedDB:
window.indexedDB.webkitGetDatabaseNames().onsuccess = function(sender,args)
{
var r = sender.target.result;
for(var i in r)
indexedDB.deleteDatabase(r[i]);
};
To remove all Chrome IndexedDB databases run the following in OSX terminal emulator.
rm -rf ${HOME}/Library/Application\ Support/Google/Chrome/Default/IndexedDB/*
Now restart your browser and that's it.
Because I need to purge IndexedDB databases very often, I have set up an alias in my ~./bash_profile.
alias purge-idb="rm -rf ${HOME}/Library/Application\ Support/Google/Chrome/Default/IndexedDB/*"
Chrome -> Inspector Window -> Application -> look at left hand menu -> Storage -> IndexedDB
You have to be on your application's page though. Also I think Safari expires IDB data after 7 days or something.
write this code segment in console
window.indexedDB.deleteDatabase(<your db name>)
To delete an IndexedDB from the OS X version of Chrome:
1) In Preferences, show Advanced Settings then click the "Content Settings" button under the "Privacy" section.
2) In the "Content Settings" popup, click the "All Cookies and Site Data" button under the "Cookies" section.
3) In the "Cookies and site data" popup, use the "Search Cookies" textbox to look up the domain that is the source of the IndexedDB.
4) Click on the domain entry in the list.
5) Click on the "indexed database" tag listed under the domain.
6) Click on the "Remove" button in the drop down detail for the indexed database.
Chrome Developer tools now have an option to delete all databases for an app, under "Application/Clear Storage".
In Debian GNU/Linux directory
/home/[username]/.config/google-chrome/Default/IndexedDB/chrome-xxx.indexeddb.leveldb/
contains regular files (for example):
000003.log, CURRENT, LOCK, LOG, MANIFEST-000002
It's not possible to delete IndexedDB database (as opposed to stores and indexes) programmatically.
As for manual workarounds, this post details the location of the database on Windows systems for Firefox and Chrome.
Update: Thanks to developer Joshua Bell, Chrome implements an off-spec (but insanely useful) deleteDatabase method on the window.indexedDB object. Here's the crbug that landed this patch. Moreover, in newer versions of IE, you can delete databases via a settings panel.
This is maybe overkill for your specific question, but I kept ending up here in my struggle to delete my idb.
My solution in the end was based on mozilla's documentation, but required that I first close the database.
For me, in Javascript, the code looked like this:
my_db_instance.close(function(e){console.log(e)});
var DBDeleteRequest = indexedDB.deleteDatabase("my_db_name");
// When i had the base open, the closure was blocked, so i left this here
DBDeleteRequest.onblocked = function(event) {
console.log("Blocked");
};
DBDeleteRequest.onerror = function(event) {
console.log("Error deleting database.");
console.log(event);
};
DBDeleteRequest.onsuccess = function(event) {
console.log("Database deleted successfully");
};
In order to complete #Judson's answer, based on #fullstacklife's comment; for deleting IndexedDB in chrome using javascript you should:
let currentIDB = indexedDB.open("DB_NAME", DB_VERSION_INTEGER);
currentIDB.onblocked = function(){
//
};
currentIDB.onerror = function(){
//
};
currentIDB.onsuccess = function(){
var idb = currentIDB.result;
idb.close();
indexedDB.deleteDatabase("DB_NAME");
};
To delete IndexedDB in Chrome on Android:
Settings
Site settings
Data stored
Search needed site and press
Delete stored data
(You cannot delete IndexedDB via Settings -> Privacy and security section, what is quite misleading...)
Alternatively, use your web application in a new incognito window, and close it when you're done: database deleted.
In chrome OSX- /Users/user/Library/Application Support/Google/Chrome/Default/IndexedDB
Firefox OSX - Users/user/Library/Application Support/Firefox/Profiles/4zaemxcn.default/indexedDB
You just need to make visible the library folder. All of the files are stored in folders(which are called as domain name) and the files use hash, but you can figure out the name of database from it.
You can delete data from IDB because it is a client side database and all of the data is stored locally.
In windows, you can manually delete the whole IndexedDB databases by locating the IndexedDB directory for the browser and deleting it
For Chrome:
C:\Users\user-name\AppData\Local\Google\Chrome\User Data\Profile 1\IndexedDB
You can delete every folder which clears up the indexedDB. You can start over now.
I needed to get rid of an indexedDB in Chrome. So I search for this lousy thing called "email assistant" on my computer using MasterSeeker. Found the thing in a bunch folders that were indexedDB in Chrome. It seemed too easy that I just delete those files. I looked up how, and ended up here. I went to chrome settings with my Windows 10 PC. I just gave it a shot at trying to clear the browsing data. Presto - all those files disappeared from indexedDB, including that dreaded "email assistant" crapola. Now when I look in the indexedDB folder all I see that has reappeared is https_mail.google.com_0.indexeddb.leveldb - which looks like a safe non-irritating thing.
//By for loop
const deleteAllDBs=async()=>{
const existingDBs=await indexedDB.databases()
for (let i = 0; i < existingDBs.length; i++) {
indexedDB.deleteDatabase(existingDBs[i].name)
}
}
//By forEach loop
const dbs = await window.indexedDB.databases()
dbs.forEach(db => { window.indexedDB.deleteDatabase(db.name) })
Since most of the answers not mentioned how to find the db names:
Open the site you want db to be cleared.
Press F12 in Chrome, select console regime.
Type indexedDB.databases().then(res => console.log(res)) to learn database names used by this website (open the result with interactive console, find the name).
Finally, as mentioned above, execute in the console indexedDB.deleteDatabase('<your database name>').