imageslr / chrome-tab-modifier

Take control of your tabs
https://chrome.google.com/webstore/detail/tab-renamer/kpijejpdbpeaakidlcopnbjohbfimnod
MIT License
10 stars 0 forks source link

Change the logic of title/url matcher ? #6

Open dnknn opened 3 years ago

dnknn commented 3 years ago

213_13093151

γ€€ γ€€ γ€€
url-RegExp-Applied to ^https://github.com/[^/]+/[^/]+/issues/.+
title @1
title matcher (.+)Β· Issue.+


Expected behavior: change the logic of title/url matcher ?

Yes, we can modify url-RegExp-Applied or title/url matcher to again to fixed, But if the default is the following logical behavior, it will be more in line with expectations/normal/smart! πŸ‘‡

Expected logic behavior:

When the title/url matcher RegExp is not equal to original document.title, the original title is retained instead of displaying such as @1...

in other words, when πŸ‘‡ , only when it matches, the title will be changed. image

in other words, when πŸ‘† the title/url matcher does not match the original title, the title will = {title}(original title)


Of course, this problem is not very big, if you think it is not good, you can close it at any time! ^_^

dnknn commented 3 years ago

🐞1: Still the above rules, I also found a bug now: If use the browser translation function, it will also become @1 at this time, It seems that there is no good solution haha,

dnknn commented 3 years ago

🐞2: Not compatible with SingleFile extension.

You should know this extension: SingleFile (🐈Repository), right?

SingleFile is used to save web pages (very powerful),

image

Click to view script code and screenshots > The following is from the author of SingleFile > > I think this could be "easily" implemented with a userscript interacting with SingleFile (see [gildas-lormeau/SingleFile/wiki/How-to-execute-a-user-script-before-a-page-is-saved](https://github.com/gildas-lormeau/SingleFile/wiki/How-to-execute-a-user-script-before-a-page-is-saved)). > > Here is below the procedure to follow in 10 simple steps: > > 1. Export your settings from the options page of SingleFile by clicking on "Export" > > ![image](https://user-images.githubusercontent.com/396787/93933394-e53dc480-fd21-11ea-93c0-e15db9d3c083.png) > > 1. Edit the downloaded file in a text editor and replace `"userScriptEnabled": false` with `"userScriptEnabled": true` > > ![image](https://user-images.githubusercontent.com/396787/93933512-13bb9f80-fd22-11ea-8321-fcb1c621e310.png) > > ![image](https://user-images.githubusercontent.com/396787/93933553-20d88e80-fd22-11ea-862c-112c795c95bd.png) > > 1. Save the file and import it by clicking on "Import" in the options page of SingleFile > > ![image](https://user-images.githubusercontent.com/396787/93933684-49608880-fd22-11ea-8215-06ff28ce5d6c.png) > > 1. Choose and install an extension like Greasemonkey, Violentmonkey etc.. Greasemonkey is available here on Firefox: [addons.mozilla.org/fr/firefox/addon/greasemonkey](https://addons.mozilla.org/fr/firefox/addon/greasemonkey) > 2. Install the extension > > ![image](https://user-images.githubusercontent.com/396787/93933263-ad368180-fd21-11ea-99b6-650588397c23.png) > > 1. Click on the button of the extension > > ![image](https://user-images.githubusercontent.com/396787/93933784-7614a000-fd22-11ea-8724-7226fd6c8e2b.png) > > 1. Select "New user script..." > > ![image](https://user-images.githubusercontent.com/396787/93933844-8c226080-fd22-11ea-8f00-0e2e2c49b914.png) > > 1. This opens a new tab. Remove the existing content of the script > > ![image](https://user-images.githubusercontent.com/396787/93933959-bb38d200-fd22-11ea-9ad2-d597d12dbf38.png) > > 1. Replace it with the script below > > ``` > // ==UserScript== > // @name [SingleFile] Display prompt to enter the title > // @version 1 > // @grant none > // ==/UserScript== > > { > > let title; > > dispatchEvent(new CustomEvent("single-file-user-script-init")); > > addEventListener("single-file-on-before-capture-request", async event => { > title = document.title; > const newTitle = prompt("Enter a title", title); > if (newTitle != null) { > document.title = newTitle; > } > }); > > addEventListener("single-file-on-after-capture-request", () => { > if (title != null) { > document.title = title; > } > }); > > } > ``` > > ![image](https://user-images.githubusercontent.com/396787/93934069-dd325480-fd22-11ea-956f-647067cce992.png) > > ![image](https://user-images.githubusercontent.com/396787/93934033-d4418300-fd22-11ea-8583-3e49f5c8cfb8.png) > > 1. Press Ctrl-S to save the changes and close the tab. > > Et voilΓ  ! From now on, when you will save a page with SingleFile, a prompt should ask you to edit the title of the page. > > ![image](https://user-images.githubusercontent.com/396787/93934749-e7a11e00-fd23-11ea-971b-134c62a39574.png)
---- - Now, here comes the problem/Bug πŸ‘‡ ![image](https://user-images.githubusercontent.com/10995302/111031972-20a18c00-8445-11eb-81a2-729011ecad22.png)
imageslr commented 3 years ago

Sorry I unintentionally unwatched this repo before and haven't receive notification until today.