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

Initial support for blocking cards on Google Desktop #454

Merged
merged 12 commits into from
May 19, 2024

Conversation

aug-dev
Copy link
Contributor

@aug-dev aug-dev commented May 8, 2024

Summary

This PR begins to implement a feature requested on #427, adding support for blocking the middle card on Google Desktop's card layout.

Further Explanations

Since this is my first PR that introduces actual code, I thought it would be a good idea to keep things simple.

This is an initial implementation that currently only supports the medium-sized card (on the right half of the screen).

There are still things to add (e.g. support for the title parameter).

I tested both on Firefox and Chromium, and no issues were found.

There seems to be an issue when running pnpm check that leads to an error, but after looking into it, I'm pretty sure that it has nothing to do with the changes made by this pull request.

Demo

demo.webm

demo-picture

P.S. I'm willing to add full support for this card layout.

Copy link
Owner

@iorate iorate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your continuous contribution. Please check my comment.

src/scripts/search-engines/google-desktop.ts Outdated Show resolved Hide resolved
@aug-dev
Copy link
Contributor Author

aug-dev commented May 13, 2024

Done!

What you said was right, the feature wasn't working at all on Firefox ESR.

I removed the use of the :has() selector and the & selector as well, since it was also causing issues.

I tested on Firefox, Firefox ESR and Chromium and everything seems to work fine.


New Features

These last few changes also include some improvements that I have been working on for the past few days.

Now this entry handler has support for the title parameter, and it seems to work well.

The rule was expanded, so now it also support the rectangle cards to the side of the larger one shown in the previous video:

demo-2.trimmed.webm

Screenshot from 2024-05-10 23-25-47

Additional Comments

Since there are so many variations to the patterns these cards have (e.g. whether it is an article or an Instagram post), it is likely that some edge cases will be found in the future, but nothing that a PR here and there can't fix.

I think it is a solid first implementation.

There are still some things I will include (support for the remaining cards), but for now, this PR is probably good enough already.

If any revisions need to be made, just tell me :)

Copy link
Owner

@iorate iorate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@iorate iorate merged commit abdea24 into iorate:master May 19, 2024
1 check passed
Copy link

🎉 This PR is included in version 8.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants