duckduckgo / tracker-surrogates

💉 Surrogates are small scripts that our apps and extensions serve in place of trackers that cause site breakage when blocked.
Other
20 stars 11 forks source link

Fix iframe sizes for custom iframe. #15

Closed franfaccin closed 1 year ago

franfaccin commented 1 year ago

Use the string from the video config when available to get the correct size units instead of parsing to an int. This fixes an issue where parsing an int of size "100%" became a video of "100" pixels.

Example page: https://playlist-randomizer.com/PLotWwwqNW_RuxxCCKYA2UT4kwICn-JsSN

ctl-bug-size

After fix:

ctl-fix-size

I'm using .toString() the same way Google's www-widgetapi.js script does it, by using the config string provided by the page.

image