Comments (3)
Seconded! This plugin needs some logic that will watch the page title and overwrite it again and again with the chosen title. It looks like Mutation Observers are the performant way to do that these days.
Something like this seems to work pretty well at writing to the console whenever the document title changes:
new MutationObserver(function() {
//The code to change the title back to what Tab Modifier wants would go here
//But for now we'll just log it for demo purposes so you can see it works.
console.log("Title changed to "+document.title);
}).observe(document.querySelector('title'),{
childList: true
});
See here for more: https://stackoverflow.com/questions/2497200/how-to-listen-for-changes-to-the-title-element
from chrome-tab-modifier.
As a stopgap, I made a JavaScript bookmarklet that will keep the tab's name set until the page is reloaded or navigated to a new page. Might be helpful to some people. If you save this as the "URL" in a bookmark, clicking the bookmark will as you to input the tab name you want, and there you go.
In one line, for a bookmarklet:
javascript: (() => { window.specialTitle = prompt('Tab name'); new MutationObserver(function() { if (document.title !== window.specialTitle) {document.title = window.specialTitle;} }).observe(document.querySelector('title'),{ childList: true }); document.title = window.specialTitle; })();
Or easier to read:
javascript: (() => {
window.specialTitle = prompt('Tab name');
new MutationObserver(function() {
if (document.title !== window.specialTitle) {
document.title = window.specialTitle;
} }).observe(document.querySelector('title'),{ childList: true });
document.title = window.specialTitle;
})();
from chrome-tab-modifier.
Hi @kaledaddy,
Seems to work now on Notion since the 1.0 is out!
Bests
from chrome-tab-modifier.
Related Issues (20)
- cannot change tab name for server http://127.0.0.1:8188/ HOT 1
- Color active tab? HOT 1
- Any keyboard shortcut to rename tab?
- Tab Modifier reborn & v1.0 HOT 4
- chrome extension market can't find Tab Modifer HOT 1
- Cannot add custom icon HOT 4
- $1 not works
- "Starts With" detection type never matches HOT 3
- Custom Icon Section needs to be fixed. Issue on New Updated Version HOT 1
- Group name is not set after reordering a tab HOT 1
- Duplicate-function leads to confusion/trouble - suspect it duplicates internal ID HOT 4
- Regression? Prior behavior for Unique was to the pattern, not the full URL of a page HOT 2
- Rename Tab function broken
- add map for matcher or regex HOT 1
- Title has been processed repeatedly.
- Tab Title of the Rule is overwritten by the Actual Website Title after page load completes. HOT 5
- Favicon briefly changes to my specified one, but then changes back once page loads HOT 5
- Regex rule does not work
- Update has deleted all current rules HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrome-tab-modifier.