Any way to remove X button from chrome tabs? - google-chrome-extension

Is there any way to modify chrome tabs to remove the button that closes the tab?
I've read through chrome develope tab. but I don't see any mention of the close button.

Not possible at the moment without forking the whole chromium project. See bug report #50913 (Status: WontFix).
Possible workarounds:
If you right click on a tab you can Pin Tab. This will remove the close button but you can still close it with ctrl+w. Unfortunately, this will also remove the window title.
The close button is removed if the width of the tab gets very small.
Have a look at the same question on SuperUser: How to disable the close (X) button on Google Chrome tabs?.
Maybe you like to look at the source code of Chromium and fix this? I think you have to start here: tab.cc.

Edit: The fix below only worked between Chrome version 69 and 71.
It IS possible now for inactive tabs!
I have had lots of problems while trying to switch tab while having 10-15 of them opened, accidentally closing some important tab with lots of text typed which isn't recovered by Ctrl+Shift+T
Here how to do that:
1) Open the Google Chrome browser and type the following text into the address bar:
chrome://flags/#close-buttons-inactive-tabs
This will open the flags page directly with the relevant setting.
2) Set the option named Close buttons on inactive tabs. Set it to Disabled using the drop down list next to the flag's name.
3) Restart Google Chrome by closing it manually or you can also use the Relaunch button which will appear at the very bottom of the page.
4) The close buttons will disappear from inactive tabs.
Before:
After:
That's it!
Source - https://winaero.com/blog/remove-close-buttons-inactive-tabs-google-chrome/

There are now Chromium-based alternative browsers which offer this - I really like Vivaldi, where not showing the X button is just one of many customization options. Also, because it is Chromium based you can install and use any Chrome extensions. It is perfect if you have many tabs open and need more of the power-user type options.

Related

How do you get all visible tabs in chrome?

I need to get the tab ids of all VISIBLE tabs in chrome. Note that this is different from currently active tabs or current tab. The user will have the current tab visible, but may have another chrome browser window in the background that may be visible on screen but won't be the current tab. I need the id of that tab as well, and all tabs like it. How can I do this? Can I do this in a way that minimizes permission use (Only using activeTab if possible).
I think that first you have to retrieve all the chrome instances.
you can do this with getAll method.
Then you can loop over all instances and for each look for the active tabs.
there is a SO answer related to this, which may help
You can use chrome.tabs.query.

How to keep extension pop up to remain open when new tab is clicked

my extension close when link in the extension is clicked
How to keep extension pop up to remain open when new tab is clicked
In general, that's not possible as stated in Chrome Extensions FAQ:
Can extensions keep popups open after the user clicks away from them?
No, popups automatically close when the user focuses on some portion of the browser outside of the popup. There is no way to keep the popup open after the user has clicked away.
However, if you inspect the popup, it will stay open as long as you don't close the Developer Tools window.
For end users, the only thing you could do is use a tab instead of a popup if that works better for your use case, or just inject your code into a specific tab to show your interface on top of/next to a page, as some extensions like Siteimprove do.

Sublime Text 3: do not close tabs automatically

I am navigating the code of a big JavaScript library using Sublime Text 3. So I need to open a lot of tabs and switch between them to capture the code co-reference. However, Sublime closes 'unused' tabs automatically for me.
How to disable it? I googled but cannot find a solution. I find a shortcut ctrl+shift+t to restore the most recent closed file, but that is not enough. I need to disable the automatic closing, and that would be better if someone shows me the short key to "display and select a file from all open files". Thanks.
When you single-click on a file in the sidebar, Sublime displays it in a "temp" view that is overwritten the next time you single-click on a file. To open a file in a "permanent" tab that stays open even when other files are opened, you simply need to double-click on the file in the sidebar.
A more direct solution that I find mildly preferable, at least until I can retrain myself to double-click when I want a tab to stay open:
In the Settings, set preview_on_click to false.
This is not quite what I want since it all it does is disable the behavior to open a preview tab on single click -- thereby forcing the user to always double click. But perhaps by working this way for a week or so I will be able to retrain my ingrained assumptions and can go back to the default behavior.
Double click that file on left sidebar you do not want to close automatically.

Feasibility of grouping tabs in Chrome

I'd like to be able to group tabs in Chrome (on Windows Vista/7 primarily), as I can with Tab Mix Plus on Firefox, so that I only see one group in the tab list at one time. I don't seem to be the only one, but it hasn't been done, so far as I can tell. There are plenty of tab managers out there, like TooManyTabs and Tab Outliner, which summarise, save and unload tabs, but they don't leave them loaded whilst hiding them.
I've not coded a Chrome extension before, but I think the specific problem is that you can't control the visibility of tabs (in the way you can with the hidden attribute of tabs in Firefox) or windows from a Chrome extension. Is that right, or have I missed something in the API?
If that is right, any way anyone can see to hack round this? Put the tabs I want invisible in a window and then use whatever Windows API allows http://www.hide-window.com/ to hide that window?

Inspect popup for extensions removed; debug console eating extension form element inputs

To debug extensions, Chrome used to have a "Inspect popup" menu option available when right clicking the extension icon (top right in the browser). I believe this options was recently removed (possibly with the latest Chrome version 20, which I am using) .
The debug console can still be activated by right clicking any element in the extension popup and selecting "Inspect element". The problem I am experiencing however is that whenever I now have the debug console open, typing into form elements in the popup does not work. Even though the form element seems to have the focus (it has a blinking cursor active), all input typed goes straight to the debug console.
Update: It seems focus is not specifically to the debug console, but to whichever window is below. It's like the extension window is a "stay on top" window, without capturing any input.
Update: 2012-07-24: Updated to 22.0.1215.0 (Official Build 147830) dev and the bug is still there. But yay, Youtube full screen now suddenly works on my dual screen system!
Update 2012-05-09: Upgraded from 20.0.1123 to 20.0.1130.1 dev on Linux x64 (Ubuntu 12.04). Problem still there, and makes debugging extensions a lot harder than needs be. Also confirmed behaviour on older Chrome release (20.0.1105.0). Oh well, maybe it's just me...
Update 2012-05-09 2: Assuming this is a bug, consider adding a background page to your popup and log to that page's console instead until bug gets fixed. At least that makes my life easier for now.
Update: 2012-10-19: As omri writes (and points to), the Inspect Popup option is on it's way to be put back into Chrome, which will hopefully solve this problem (finally).
Could anybody confirm/deny this behavior, and/or suggest possible workarounds?
Open the popup
Right click the popup window and inspect.
Its going to be re-added to chrome
http://code.google.com/p/chromium/issues/detail?id=143349
Update: Un-accepting answer as another user confirmed this behaviour for OSX, so at least it will appear as unsolved on the radar, although there's probably a bug tracker somewhere where this needs to be posted.
This bug is still present on google-chrome-beta (Version 20.0.1132.34 beta). I'm guessing that this has to do with window and popup handling on X11 generally, and is obviously not a high priority bug since it's remained this way for quite a few releases. Closing question.
I am seeing the missing "Inspect Popup" option on right click but, I can edit/enter text in the form fields.
I am wondering if you are having an unrelated problem? If you are using or updating to the new 2.0 Extension Manifest you can encounter issues where inline javascript in the popup fails to fire any longer because of the addition of the content_security_policy defaults. Basically this prevents script injection but also seems to kill all JS in your popup. There are ways around this by changing the way events are handeled in your popup or by changing the default policy. Here's a link to the doc on this: http://code.google.com/chrome/extensions/contentSecurityPolicy.html
This is just a guess because I don't know what's going on in your code but I saw similar things while upgrading my extension recently.
Just upgraded to 22.0.1221.1 (Official Build 149058) dev and the problem seems to have been solved, albeit with a workaround. The old way of right clicking in the popup window and selecting "Inspect Element" to start up the console still grabs all input as originally reported.
However, it seems by right clicking the popup icon, the old "Inspect Popup" seems to be back, and when this is used it does not seem to grab input from the open popup window itself.

Resources