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

Option to avoid duplicates #36

Open
azumukupoe opened this issue May 1, 2020 · 23 comments
Open

Option to avoid duplicates #36

azumukupoe opened this issue May 1, 2020 · 23 comments

Comments

@azumukupoe
Copy link

Is it possible?

@Revadike
Copy link
Owner

Revadike commented May 1, 2020

Could you please explain what you mean?

@azumukupoe
Copy link
Author

I don't need to see more than one "swi-block boxed" for each game

@Revadike
Copy link
Owner

Revadike commented May 1, 2020

I don't need to see more than one "swi-block boxed" for each game

Define "game". The script can only see links and images. It doesn't know if they belong together.

@azumukupoe
Copy link
Author

I don't need to see more than one "swi-block boxed" for each game

Define "game". The script can only see links and images. It doesn't know if they belong together.

Sorry, I meant appid

@Revadike
Copy link
Owner

Revadike commented May 1, 2020

so, per page, u only want it to show icons ONCE per appid?

@azumukupoe
Copy link
Author

Maybe per frame?

@Revadike
Copy link
Owner

Revadike commented May 1, 2020

Maybe per frame?

frame?

@azumukupoe
Copy link
Author

Maybe per frame?

frame?

<iframe>?

@AxJ11
Copy link

AxJ11 commented May 20, 2020

Is it possible to make the script only show up icons once within the same block/div section?

https://i.imgur.com/Mn8fMy3.png
https://i.imgur.com/MUU0p1T.png

@Revadike
Copy link
Owner

Probably, but this likely doesn't apply to every case. And how many blocks higher up do u want to go when selecting this group. It's something hard to implement globally for every case.

@AxJ11
Copy link

AxJ11 commented May 20, 2020

Yes, I think it's would be a huge work for the whole process. Maybe deal one specific URL category at a time? I mean to customize the rule for each specific URL(giveaway All/Wishlist/.., Entered/Won/..., inside each giveaway and discussion post. Because the page structure of each URL may not change drastically very often, maybe it's possible to make a specific rule for each URL category?

For example, for "inside each giveaway," there are always three sections( to detect):

  1. div class="featured__container"
  2. div class="page__description"
  3. div data-comment-id="56449198" class="comment esgst-es-page-1" => ESGST
    div data-comment-id="56449198" class="comment" => Original

Can we use these "class" and "data-comment-id" for the detection boundary?

And I think there are similar div structures to capture just like those mentioned above for other URL categories, eg. giveaway All/Wishlist/.., Entered/Won/... and discussion post.

https://i.imgur.com/MmOHWl8.png
https://i.imgur.com/WahrLT6.png

@Revadike
Copy link
Owner

Revadike commented May 20, 2020

I'm trying to keep it a global solution. If I start filtering and supporting different sites individually, it will be too hard to maintain. Besides, most individual sites have their own scripts/addons out there.

@AxJ11
Copy link

AxJ11 commented May 20, 2020

Sure, of course. It's probably the best to work with your own workflow and workaround.

@AxJ11
Copy link

AxJ11 commented May 22, 2020

Or you can think it's a backup workaround since the Steamgifts.com is probably the only website with this problem because of ESGST.

@AxJ11
Copy link

AxJ11 commented Jun 3, 2020

Another idea about the solution is to have an option to show the tag only when the HTML value or content contains the string of the "game title" or the word "Steam." Does it make sense?

Also, it's probably great to have a system to let users decide what webpages/websites to customize the condition of the way when the tag shows up, e.g. the detection range or by game title rather than the appid in the URL. Maybe this could reduce your workload.

@AxJ11
Copy link

AxJ11 commented Jun 3, 2020

...how many blocks higher up do u want to go when selecting this group. ...

Maybe one or two tiers up? Or have a system let users decide how far is the selecting range per webpage respectively.
I also found the bundle page of Barter.vg has this problem too. And the issue fits the one-tier up selection.
https://i.imgur.com/Wg1MlXa.png

@Luckz
Copy link
Contributor

Luckz commented Jul 26, 2020

There are a lot of sites where "invisible marking" can happen, meaning due to the page design, a SWI checkmark and such will be added to the DOM but not visible to the user. Just showing the first match per app ID is no solution if for a particular site it's the second or third match that they would conveniently see.
On the other hand I agree with the benefit of this suggestion, seeing several SWI annotations for each game can definitely be annoying on some websites.

One idea would be to kind of pollute the user settings with per-site nth element preferences or selector limitations / custom regex.

@AxJ11
Copy link

AxJ11 commented Jul 26, 2020

Not quite sure what you meant but thanks for the input. Luckily, at least on ESGST end, the duplicated tags on Steamgifts.com would probably be solved by editing the URL of the "Game Categories" tag because the author added the feature this weekend. Hope this change would be live in 1~2 days.

@AxJ11
Copy link

AxJ11 commented Aug 1, 2020

Finally, the duplicated thing is reduced to the minimum, err....almost, on Steamgitfs.com because of the recent update of the ESGST. Now, can we have a system to let the user choose and save which HTML tag, class, id not showing the icon for a specific url or web title?

The last mile...almost done!
https://i.imgur.com/97lzzdh.png

@Luckz
Copy link
Contributor

Luckz commented Jan 24, 2021

Not quite sure what you meant

Assume you're on a website.
Let this website have an IMAGE for each game, a LINK to it on the image, and ANOTHER LINK for example on the price field. That game now exists three times.
Depending on web design / CSS, or even your resolution/device, SWI-added icons might be visible on all three, or might be visible on only 0/1/2 of them.
It's thus individual to each website that SWI can modify which HTML element should be annotated (for the very same game).

@AxJ11
Copy link

AxJ11 commented Jan 31, 2021

@Luckz Like your explanation and solution. Good job!!!

BTW, an update a long time ago on the Steamgifts.com giveaway page, finally no more duplicate icons:
https://i.imgur.com/VagLAsK.png
It took me some time to find out that the SWI icons can only be modified through the "GM_addStyle" method. Don't know why. 🤔

@bestpika
Copy link
Contributor

bestpika commented Mar 12, 2021

It may be possible to check if the parent element is the same one.
However, if the pages are too complex, it is very difficult to check.

@Revadike
Copy link
Owner

It may be possible to check if the parent element is the same one.
However, if the pages are too complex, it is very difficult to check.

This made me think. How high should the parent node be, since eventually they're all under the same root node. But perhaps we can look at subtrees that exclusively contain the same appid and avoid those occasions from happening somehow.

So, when you add a new SWI-block, you recursively keep checking the parent node for SWI-block children, and if they all have the same appid, make sure only one is displayed.

Now, poses a new set of issues:

  • How do you check if you have not added all SWI-blocks yet?
  • Which SWI-block do you want to display and which to hide?
  • How badly will this impact performance?
  • How will it work for every kind of web page.

Yeah... that's a lot of difficult issues to tackle.

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

5 participants