Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Doublicate Items From Array #30

Open
ghost opened this issue Jun 21, 2015 · 7 comments
Open

Remove Doublicate Items From Array #30

ghost opened this issue Jun 21, 2015 · 7 comments

Comments

@ghost
Copy link

ghost commented Jun 21, 2015

Hi,

I absolutely love this extension... BUT

The extension seems to check doublicate URLs / Links which are on a given page - it would be handy to have a option / feature that turns this off/on

Thanks a LOT

mariano

@ocodia
Copy link
Contributor

ocodia commented Jun 21, 2015

Good idea, Mariano, I'll keep that in mind when I'm doing the next round of improvements. In the mean time you can enable caching on the options page of the extension, and that will prevent it from checking links which are known to be working ok (which should speed up page checks significantly).

Paul Livingstone

On 21 Jun 2015, at 14:52, IamDevelish notifications@github.com wrote:

Hi,

I absolutely love this extension... BUT

The extension seems to check doublicate URLs / Links which are on a given page - it would be handy to have a option / feature that turns this off/on

Thanks a LOT

mariano


Reply to this email directly or view it on GitHub.

@ghost
Copy link
Author

ghost commented Jun 21, 2015

for a quick fix for me i just added this to the file "check.js" at round line 190

          else{
          queued +=1;
          blacklist.push(url); // added this line
          link.classList.add("CMY_Link");
          checkURL(url, link);
          }

I add an item to the blacklist array - this way a url is counted and checked only once

@kyleladd
Copy link
Contributor

Good idea,

To continue down that path, let's say there is a 404 link (http://notreal.ex) in multiple places within the DOM. By only checking the link once the classes link.classList.add("CMY_Valid"); or link.classList.add("CMY_Invalid"); would only be added to one of the links.

As a result, there would need to be a modification to the updateDisplay function. updateDisplay would need to be passed pageLinks array. updateDisplay would then need to cycle through the pageLinks array and add the corresponding class to all elements with the checked url.

-Kyle

@ghost
Copy link
Author

ghost commented Oct 29, 2015

Could you please include a dublicate url check in the current / future release? When I edited the files Chrome warned me that the plugin is not valid / is broken.

@kyleladd
Copy link
Contributor

kyleladd commented Nov 1, 2015

This can be done. Filter pageLinks to only unique links based on the link.href attribute. Just make sure that when updating the UI, update all instances of the link.href in the DOM with the linkStatus and warnings.

@ghost
Copy link
Author

ghost commented Nov 1, 2015

It would be great if it could be an option in the config screen - and in the main branch :-)

@ghost ghost closed this as completed Nov 1, 2015
@ghost ghost reopened this Nov 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@chasers @ocodia @kyleladd and others