dieparteidiepartei / afd-blocker-plugin

AfD Blocker Browser Plugin
ISC License
283 stars 30 forks source link

Dynamically added content is not blocked #4

Closed mohe2015 closed 5 years ago

mohe2015 commented 5 years ago

Example page: https://www.sueddeutsche.de/news?search (after https://github.com/dieparteidiepartei/afd-blocker-plugin/pull/3 would be merged)

mohe2015 commented 5 years ago

This is done by #3

RaisingAgent commented 5 years ago

This issue is generally because content scripts are only run once afaik. Maybe we can subscribe to some dom ready event of the site(s)

mohe2015 commented 5 years ago

This issue is generally because content scripts are only run once afaik. Maybe we can subscribe to some dom ready event of the site(s) @RaisingAgent https://github.com/dieparteidiepartei/afd-blocker-plugin/commit/85179414bc8c0581d5f3c6d215b318b0a4ed151f#diff-22a7ffd3af499eb889e92ff609c54934R106 I used a mutation observer.

dieparteidiepartei commented 5 years ago

Hey, could you deactivate the observer while running addBlocker?

RaisingAgent commented 5 years ago

@mohe2015 slighty off topic, but i'm curious. Does var self = this; keep the this of the outer scope, whilst this would refer to the current scope in watchPageForMutations(). (i've used that before, but I don't think it makes a difference)

mohe2015 commented 5 years ago

@RaisingAgent I'm not a JavaScript expert but I think otherwise this refers to the scope of the MutationObserver.