hoyois / clicktoplugin

Prevents plug-ins from loading automatically in Safari
http://hoyois.github.com/safariextensions/clicktoplugin/
229 stars 43 forks source link

Updated killer for spiegel.de #173

Closed psandtner closed 8 years ago

psandtner commented 8 years ago

The current killer „Spiegel.js“ does not work anymore. Attached is a new one.

@hoyois: Could you please update it?

Spiegel.js.txt

hoyois commented 8 years ago

@psandtner Can't you get the video ID using a simple http request? Your script creates a new event listener in the extension's global page for each video. That sounds bad...

psandtner commented 8 years ago

@hoyois My investigations on http://www.spiegel.de/video/ came to the conclusion that the video ID only resides in the DOM. The "data" variable does not contain any useful information. I’m new to safari-extensions and javascript ist not my best friend. I understand the problem with the event listeners. Is it possible to change my approach to only register it once?

hoyois commented 8 years ago

I don't see how, no. To properly work with dynamic DOMs, we'd need the data variable to contain the whole DOM, which doesn't sound great either (and anyway can't be helped now). At least, you can remove the event listener when the message is received.

psandtner commented 8 years ago

I've made some more changes to the killer. What do you think?

Spiegel.js.txt

psandtner commented 8 years ago

Sorry, closing by mistake.

hoyois commented 8 years ago

Thanks, I've uploaded the new killer.

https://github.com/hoyois/plugin-to-html5/blob/master/Spiegel.js