chrome-tab-modifier icon indicating copy to clipboard operation
chrome-tab-modifier copied to clipboard

Tab substitutes correctly at first but not after navigation (Google Drive)

Open davidrbrake opened this issue 4 years ago • 3 comments

In case of bug report, please fill this template and remove italic lines Otherwise, clear all and type :)

Tab Modifier version

Browser: Chrome

Extension version: 0.22.0

Expected behavior

Matching https://drive.google.com/drive/u/0/my-drive should substitute "personal drive" (since https://drive.google.com/drive/u/1/my-drive is my work google drive) but https://drive.google.com/drive/u/0/folders/1rhDAaEsdI3FZY90dmWpJWcn26wVPRtRI should stop substituting because it no longer contains https://drive.google.com/drive/u/0/my-drive

Actual behavior

Tab name remains "personal drive" even when I go into folders.

Steps to reproduce the behavior

image image

davidrbrake avatar Oct 01 '20 14:10 davidrbrake

I think the issue is that Google Drive is an SPA, they don't reload the page (so the script) when you browse into folders... This is a common issue with SPAs.

sylouuu avatar Oct 01 '20 15:10 sylouuu

I think the issue is that Google Drive is an SPA, they don't reload the page (so the script) when you browse into folders... This is a common issue with SPAs.

Ah - even though the URL does change! Is there a work-around?

davidrbrake avatar Oct 01 '20 15:10 davidrbrake

I have the same issue here with Jenkins BlueOcean pages, which I believe are also SPAs. I would love to see a workaround added to this extension such as using a MutationObserver to update the tab title whenever the dom changed. Maybe have a configurable time in ms that the dom is checked for changes. If it was done on a per-rule basis it would not be too bad on performance. Also, if you allowed users to specify a dom selector to watch for mutation changes on these special types of rules it would be even more performant. Could something like this work? Seems like other chrome extension devs have had this problem too....here's a stackoverflow discussion on the topic: https://stackoverflow.com/questions/2844565/is-there-a-javascript-jquery-dom-change-listener/39508954#39508954

minorgod avatar Nov 11 '21 01:11 minorgod