Google Docs viewer returning 204 responses, no longer working, alternatives?

后端 未结 7 1914
执念已碎
执念已碎 2020-12-08 01:01

UPDATE 2016-11-16 9:53am EST

It appears many people are still seeing 204 responses even though Google has claimed to have \"fixed\" the problem. Wh

7条回答
  •  温柔的废话
    2020-12-08 01:38

    I was able to get this to work with Тетяна Волошка's answer, however I had to remove the if statement because

    This

    iframe.contentDocument.URL == "about:blank"
    

    caused

    DOMException: Blocked a frame with origin from accessing a cross-origin frame.
    

    I'm not quite sure why this fixed it for me. Perhaps the 2 second delay allowed everything else on my page to load and remove any conflict for the embedded pdf to load, but how else could i get the content document without a the cross-origin issue?

提交回复
热议问题