KudoAmine Author

Re: @middlerob:

That can be a solution as well, searching for id instead of data-testid

but since [data-testid*="test"] doesn't work for you means you have some different value there..

For me, all feed posts' element (that is for the "Sponsored" text), its data-testid value start with test-
Here is an example:

Thus, the script works fine for me, also I've heard from people that it worked for them too.

So my conclusion is that some FB users have different values in there than others, and in that case I won't be able to make the script work for everyone, instead, people should change the value to what is shown to them.

And by the way, if I were to use what you suggested ([id^=feedsubtitle]), it won't work, since for me the id starts with fe_edsubtitle and not feedsubtitle.

Re: @ajsnyde:

As I tried, innerText does actually get the right text, here is what it returns when I use it for that element:
InnerText returns the right text
Well, it's the right text with some spaces or so, but since I'm using indexOf to check for these sponsored texts, it doesn't matter.

So, I believe the reason for why the script isn't working for you is something else that I will state in the next reply.