GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add Whitelist by Banaanae · Pull Request #372 · ClearURLs/Addon Conversation
|
|
Using a library like tld.js could fix the first issue |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
still needs to update after press
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Button now reflects whitelist status instantly - Fixed bug where only last site whitelisted displayed properly - No longer breaks when spammed - Removed test code
|
I'm marking this as ready for review, before merging a few things need to happen
Not going to do the last task, a bit above my skill level |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@KevinRoebert do you have any plans to merge this? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Would be great to have it, as currently clearurls breaks amazon sorting, resulting in user not being able to select any other sorting. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Banaanae First of all, thank you for your contribution. I am currently reviewing the code. It still needs some changes and also has a couple of bugs. I will make the changes directly and then merge. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * Skip whitelisted sites | ||
| */ | ||
| for (const site of storage.whitelist) { | ||
| if (url.indexOf(site) != -1) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
!==
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| siteFound = true | ||
| } | ||
| }); | ||
| if (!siteFound) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Swap both cases
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| }); | ||
| if (!siteFound) { | ||
| if (data.response.length != 0) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Remove this If. It causes the button to retain the "btn-danger" class when a page is added and immediately removed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| function: "getData", | ||
| params: ['whitelist'] | ||
| }).then((data) => { | ||
| data.response.forEach(site => { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should be replaced by the following: let siteFound = data.response.some(site => currentSite.indexOf(site) !== -1);
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * @param {boolean} remove If true remove current site instead of adding | ||
| */ | ||
| function changeWhitelist(removeWl = false) { | ||
| if (removeWl != true) { // Handle click obj |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Assignment is useless. It is better to pass the correct state in the onclick event
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| element.classList.replace('btn-danger', 'btn-primary') | ||
| } | ||
| element.textContent = translate('popup_html_configs_whitelist_button_add') | ||
| document.getElementById('whitelist_btn').onclick = changeWhitelist; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Pass the desired state here: () => {changeWhitelist(true)}
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| }).then((data) => { | ||
| let siteUrl = new URL(site) | ||
| let domain = siteUrl.hostname | ||
| if (removeWl == false) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Swap both cases
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (removeWl == false) { | ||
| data.response.push(domain) | ||
| } else { | ||
| data.response = data.response.filter(wlSite => wlSite != domain) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Unsafe comparison, better !==
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks for your work, just noticed as I was posting in the other thread about a new issue I found, unrelated to your fix. I'm gonna quote my post as to not retype it, just thought if your actively working on it you might be interested. :)
Personally, I still use this mod BUT it's really good to get a list of places and situations, so we can be aware to disable manually Looking forward to trying your fixes! :D |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Eagerly awaiting this! (Or please kindly point to where I can download this build!) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Bumping this - tons of sites are broken, most critical the google drive suite. This really needs more attention |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
i missed this PR and related issue and made new PR #383 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
any news about that ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Banaanae: Can you create a PR on Gitlab too? If it is not merged, I think it is the moment to fork this project. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Neustradamus this was done in #372 (comment) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Un cordial saludo. Solicito de su apoyo para impedir el redireccionamiento de enlaces URLs. Aún soy nuevo en programación y en Github. De favor realizó una solicitud de extracción para poder contribuir y poder llevar a cabo con eficiencia mi privacidad. Gracias.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Feature request to be able to exclude websites
There was an error while loading. Please reload this page.