ublacklist icon indicating copy to clipboard operation
ublacklist copied to clipboard

Not working at all on Startpage.

Open linlinxza opened this issue 1 year ago • 1 comments

Expected Behavior

Filtering should work on startpage.

Actual Behavior

Not filtering at all.

Steps to Reproduce the Problem

1.Install addon 2. Add an expression like *://*.reddit.com/* 3. Enable for startpage.com 4. Activate 5.Search for reddit

Specifications

  • Browser: Librewolf
  • Search engine: Startpage.com
  • Language: EN
  • Region: CA

It might be worth also checking the mobile version of startpage.

linlinxza avatar Apr 19 '24 03:04 linlinxza

So, when's a new update going to be pushed for this? Because I really want to see all this junk disappear from my search results:

*://*.reddit.com/*
*://*.fb.com/*
*://*.redditinc.com/*
*://*.linkedin.com/*
*://*.threads.com/*
*://*.meta.com/*
*://*.messenger.com/*
*://*.metacareers.com/*
*://*.snapchat.com/*
*://*.apple.com/*
*://*.icloud.com/*
*://*.live.com/*
*://*.msn.com/*
*://*.microsoft.com/*
*://*.office.com/*
*://*.skype.com/*
*://*.bytedance.com/*
*://*.microsoft365.com/*
*://*.windows.com/*
*://*.hpconnected.com/*
*://*.hpsmart.com/*
*://*.samsung.com/*
*://*.canon.com/*
*://*.play.google.com/*
*://*.myspace.com/*
*://*.adobe.com/*
*://*.photoshopessentials.com/*
*://*.photoshop.com/*
*://*.bing.com/*
*://*.bingplaces.com/*
*://*.xbox.com/*
*://*.adobepress.com/*
*://*.amazon.com/*
*://*.primevideo.com/*
*://*.deviantart.com/*
*://*.deviantartsupport.com/*
*://*.deviantartsell.com/*
*://*.pinterest.com/*
*://*.tumblr.com/*
*://*.quora.com/*
*://*.visualstudio.com/*
*://*.sharepoint.com/*
*://*.facebook.com/*
*://*.twitter.com/*
*://*.instagram.com/*
*://*.tiktok.com/*
*://www.redditstatus.com/*
*://www.redditforbusiness.com/*
*://support.reddithelp.com/*
*://www.whatsapp.com/*
*://*.x.com/*
*://business.tiktokshop.com/*
*://www.onenote.com/*
*://sway.cloud.microsoft/*
*://*.amazon.ca/*
*://*.yahoo.com/*
*://www.yahooinc.com/*
*://discord.com/*
*://discordapp.com/*

linlinxza avatar Apr 28 '24 18:04 linlinxza

I am also facing this issue and after trying to debug it I found that the class name of startpage has most likely changed. Specifically w-gl__result no longer exists and .result exists under .w-gl. I tried adding the following config to my entryHandler but it didn't work:

          {
            target: '.result',
            url: '.result-title',
            title: 'h2',
            actionTarget: 'a[role="link"]',
            actionStyle: {
              display: 'block',
              marginTop: '4px',
            },
          },

What's strange is that the class name set with the result class displayed in Element is different from the corresponding class name set in Sources. This is not seen in duckduckgo, which works properly.

misumisumi avatar May 01 '24 17:05 misumisumi

What about just use .w-gl? Or, could link-text work?

When I see something like this while inspecting, <span class="link-text">https://www.reddit.com/</span>, I suspect that could be used to filter out URLs. No? So, should the target be link-text?

linlinxza avatar May 01 '24 19:05 linlinxza

At least I don't think .w-gl can be used because it is a container for the entire search result. 2024-05-02_04-21

misumisumi avatar May 01 '24 19:05 misumisumi

link-text?

linlinxza avatar May 01 '24 21:05 linlinxza

Thanks @misumisumi for the ideas for a solution. I've looked at it some more and am currently trying this:

    entryHandlers: [
      // Web
      {
        target: '.w-gl > .result',
        url: '.w-gl > .result .result-title',
        title: 'h2',
        actionTarget: '.w-gl > .result > .description',
        actionStyle: {
          display: 'block',
          marginTop: '4px',
        },
      },
      . . .
   ]

This seems to make filtering work (I'm not sure what actionTarget is used for). Please try this and let us know if it works for you.

However, there is still some more work to do. It seems that the headline uBlacklist has blocked 1 site and Show button are not appearing at the top of the Startpage search results.

I have tried updating the control handler target

    controlHandlers: [
      // Web
      {
        target: '.Layout #main',
        style: defaultControlStyle,
      },
      . . .
   ]

but so far this hasn't worked. I'm not sure what it's looking for.

I may keep trying, though hopefully this info so far might be enough to be helpful to @iorate 😀

stevehartwell avatar May 01 '24 21:05 stevehartwell

However, there is still some more work to do.

One of the problems is no showing Block this site, but I think this is due to the html class being changed for some reason. For example in duckduck-go, elements and classes referenced from Element and content-script.js are the same. image image

But in startpage, elements and classes refferenced from element and content-script.js are not the same. I checked with all other extensions such as adblock disabled, so I think it's a problem on the startpage side. image image

Probably, the behavior is to search for the entry container with target, specify the element within it with actionTarget, and add a block button with span to the specified element.

misumisumi avatar May 02 '24 04:05 misumisumi

@misumisumi @stevehartwell Thank you for your investigation. I'll fix this issue soon.

Since the current version of Startpage uses React, modifications by the content script are cleaned up by the hydration process. To avoid this, the content script should be run after the page is loaded:

https://github.com/iorate/ublacklist/blob/924de298eb24b4c1d5a741baa211c6675f926314/src/common/search-engines.ts#L527 This value should be "document_idle".

iorate avatar May 04 '24 11:05 iorate

Probably, the behavior is to search for the entry container with target, specify the element within it with actionTarget, and add a block button with span to the specified element.

That's true.

iorate avatar May 04 '24 11:05 iorate

:tada: This issue has been resolved in version 8.6.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar May 05 '24 07:05 github-actions[bot]