martok / palefill

Inject Polyfills for various web technologies into pages requiring them
https://martok.github.io/palefill/
Mozilla Public License 2.0
81 stars 9 forks source link

GitHub profile: member's "GitHub Stats" not displaying #55

Closed Vangelis66 closed 1 year ago

Vangelis66 commented 1 year ago

Browser: Serpent v52.9.0 (2022-08-24) (32-bit) Extension version: palefill-1.23 (latest stable release)

STR

  1. Navigate to: https://github.com/danyalasif
  2. Scroll a bit down until you reach the section https://github.com/danyalasif#languages-and-tools In it you'll see an image/"wizard" displaying (correctly) the percentages of "Most Used Languages"; but just under it, two (almost) empty "wizards" are being displayed:

GHstats

OTOH, on a Chromium-based browser, everything looks OK:

GHstats1

I've searched it a bit and came to the conclusion the issue is CSP related... All 3 "images" are being served from a camo.githubusercontent.com hostname; while the first displays OK, the other two (with dynamic content?) don't... 2nd "image": https://camo.githubusercontent.com/ece0c8060b134effe1fc5358eac0dd567d35b8c3bb7be2e73510f970a15cd8de/68747470733a2f2f6769746875622d726561646d652d73746174732e76657263656c2e6170702f6170693f757365726e616d653d64616e79616c617369662673686f775f69636f6e733d74727565266c6f63616c653d656e 3rd "image": https://camo.githubusercontent.com/910a8cef836efb36af907d2754ce875141fc1c563c427abe18a60c8f2aed2473/68747470733a2f2f6769746875622d726561646d652d73747265616b2d73746174732e6865726f6b756170702e636f6d2f3f757365723d64616e79616c6173696626

If I set security.csp.enable;false in my browser's about:config, then these two links above open and display fully in a new tab (but disabling CSP globally won't make them display inside the profile page...).

Could palefill help reproduce Chromium's behaviour of displaying correctly the member's GitHub Stats?

Thanks for the wonderful job you're doing here with palefill ! 🥇

SeaHOH commented 1 year ago

My solution: https://github.com/SeaHOH/github-wc-polyfill/blob/97ff83f083bc43d1654b09fc40256460ed179f1e/bootstrap.js#L446-L453

AroKol78 commented 1 year ago

also displays (without any combination) well on "github-wc-polyfill-1.2.19.3-unofficial"

Vangelis66 commented 1 year ago

Thank you both for your valuable input 😄 , which did lead me to the correct conclusion...

I am most embarrassed and deeply ashamed 😊 to admit that this very issue I submitted is an INVALID one... 😭 My judgement was clouded, hence the false alarm...

In my dirty St52 profile, I disabled palefill-1.23 and then enabled github-wc-polyfill-1.2.19.3-unofficial; contrary to the testimony by AroKol78, loading https://github.com/danyalasif#languages-and-tools still displayed as the first attachment in my opening post... But then I had an epiphany: I tried on a new/fresh profile of St52, with just github-wc-polyfill-1.2.19.3-unofficial installed, and, lo and behold, Danyal's "GitHub Stats" were displaying correctly! Then I launched a new/fresh St52 profile with just palefill-1.23 installed, and the outcome was the same!

It never dawned on me, initially, that "my issue" was somehow caused by something inside my dirty profile, and I was quick to put the blame on my GitHub-related extension... Shame on me...

Finding that "something" took me a while; it wasn't an extension (or an extension setting), but a user-modified about:config preference: image.animation_mode Its default value is normal, but a long time ago I had modified it to none, mainly to get rid of annoying GIFs: http://kb.mozillazine.org/Animated_images_in_RSS_feeds_%28Thunderbird%29 Resetting that pref to its default value of normal made the two, previously empty, stats images display as intended! So, apologies for the noise 😜 ...