njelich/LinkOff

LinkedIn Learning and Ads reappear after site refresh

njelich opened this issue · 4 comments

When Learning and Ads are on, and the website is refreshed, they are still present until the hider is triggered again, for example, by toggling the extension.

This might be happening because the onload function is not triggering correctly, or because the onload function triggers before the elements in question are rendered in.

Added a solution, but it is not ideal. The code attempts to add/remove the hide property, and uses a timeout and a Promise to keep doing that until it is found. Currently capped it at 50 attempts. Won't work if LinkedIn takes more than 20ish seconds to load.

The document_end property cannot be used since LinkedIn is a Single Page App.

Also need a better listener for URL changes, the current one is not working well. The old less optimal one might have been better...

Resolved in v0.4, closing