How to customize google chrome tab hover cards

1.4k Views Asked by At

Is there any workaround to customize the tab hover card of chrome 78+? By customize I mean to change the text of the hover card.

The page was opened blank and then html text is added using write function. Then I changed the title.

var win = window.open();
win.document.write(htmlText);
win.document.title = htmlFileName

My actual problem is, when I hover a tab it shows 'Loading...' instead of the actual title(value of htmlFileName).

"I know that it is not a good move to ask the user to set the chrome flag tab-hover-cards to disabled" Also, the solution should support ie9+

2

There are 2 best solutions below

1
On

Adding win.document.close() doesnt keep the tab in the loading state.

var win = window.open();
win.document.write("<html>Hi</html>");
win.document.title = "Testing";
win.document.close();

The above piece of code worked for me.

0
On

Though this issue is more than 1 year old. Still I would like to suggest a solution. Please try the below:

var win = window.open("about:blank");
win.document.write(htmlText);
win.document.title = htmlFileName

Adding "about:blank" inside window.open will show the title of the page on tab hover card instead of "loading...."