Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Imgur Embed JS embeds only one gallery

I'm trying to dynamically replace links to imgur with embeds.

I go through the page and replace links with this:

<blockquote class="imgur-embed-pub" lang="en" data-id="a/XXXX"><a href="https://imgur.com/a/XXXX">https://imgur.com/a/XXXX</a></blockquote>

After all is changed I append this to the end of the body:

<script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>

First gallery gets replaced with proper embed without problem. But any subsequent galleries are left as-is. The link is wrapped with proper blockquote tag but the JS doesn't touch it.

I see this error in console:

Uncaught DOMException: Blocked a frame with origin "https://imgur.com" from accessing a cross-origin frame.
    at addFrame (https://imgur.com/a/XXXX/embed?pub=true&ref=https%3A%2F%2F2Flink%2F&w=540:656:31)
    at makeStub (https://imgur.com/a/XXXX/embed?pub=true&ref=https%3A%2F%2F2Flink%2F&w=540:744:17)
    at https://imgur.com/a/XXXX/embed?pub=true&ref=https%3A%2F%2F2Flink%2F&w=540:749:9
    at https://imgur.com/a/XXXX/embed?pub=true&ref=https%3A%2F%2Flink%2F&w=540:772:7

though based on the ID it actually is related to the one gallery that actually works.

If I try to change the order of galleries then it's the same, first one works, so it's not a problem with specific link.

Any ideas?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!