top | item 40900154

(no title)

Featherknight | 1 year ago

Oh wow, I was just thinking that optional image previews would make this great, good stuff! The preview image doesn't auto-fit nicely in all layouts(using sonyalpharumors.com to test; works great for header banner embeds but potentially awkward sizing for post embeds) but I think that's due to the fixed image size and you not messing with the DOM outside of adding the img to it. Will you post this somewhere like github or greasyfork?

I do have the 3rd party iframes blocked globally in uBo Firefox and works great with your script to replace the placeholder elements but Safari lacks an alternative sadly afaik

discuss

order

schiffern|1 year ago

Yeah I should put this somewhere! In the meantime, right after img.alt =... you can add

  // improve styling
  img.className = frame.className;
  img.id = frame.id;
  img.style.width = frame.width +"px";
That last line is a hack (eg resizing), but it's required to make the test website work since annoyingly their CSS uses :is(frame).