4gen.js getting blocked when embedding document on SSL page in latest version of Chrome

114 views
Skip to first unread message

hain...@goalbookapp.com

unread,
Feb 15, 2013, 7:27:35 PM2/15/13
to scribd-platfo...@googlegroups.com
I am using the javascript API to fetch documents and display them using the html5 viewer. The containing page is displayed using https. It was working fine until recently in Chrome I started seeing this in the console:

  1. Uncaught ReferenceError: DocumentManager is not defined content_inner:34
  1. Uncaught TypeError: Cannot call method 'setupTestElements' of undefined content_inner:55
  1. Uncaught TypeError: Cannot call method 'addPage' of undefined content_inner:117
  1. Uncaught TypeError: Cannot call method 'allPagesAdded' of undefined content_inner:146
  1. Uncaught TypeError: Cannot read property 'options' of undefined

It appears that the 4gen.js is being referenced using http instead of https, and Chrome blocks it, thus causing subsequent javascript to fail. My javascript code is as follow:

    // prepare the scribd doc
    var scribdDoc = scribd.Document.getDoc(docId, accessKey);
    var onDocReady = function(e) {
      // console.log("ready");
      scribdDoc.api.setPage(1);
    };

    try {
      scribdDoc.addParam("jsapi_version", 2);
      scribdDoc.addParam("use_ssl", true);
      scribdDoc.addParam("page", 1);
      scribdDoc.addParam("mode", "slideshow");
      scribdDoc.addParam("width", "100%");
      scribdDoc.addParam("height", parseFloat(percentage)/100 * modalHeight);
      
      scribdDoc.addEventListener("docReady", onDocReady);
      scribdDoc.write(embeddedDocId);  // the id of the container to hold the previewer
    } catch (e) {
      console.log(e);
    }

This is only failing in Chrome 24. Firefox, Safari, and IE 8 still render the viewer. Anything I'm doing wrong, or any tips or workarounds? 

Jared Friedman

unread,
Feb 15, 2013, 8:35:51 PM2/15/13
to scribd-platfo...@googlegroups.com
Thanks for reporting.  We've located the issue here and will push out a fix in our next deploy - early next week.

--
You received this message because you are subscribed to the Google Groups "Scribd Platform Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scribd-platform-dev...@googlegroups.com.
To post to this group, send email to scribd-platfo...@googlegroups.com.
Visit this group at http://groups.google.com/group/scribd-platform-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

hain...@goalbookapp.com

unread,
Feb 18, 2013, 1:54:23 PM2/18/13
to scribd-platfo...@googlegroups.com, ja...@scribd.com
Great thanks - where can we find out when it has been released?
To unsubscribe from this group and stop receiving emails from it, send an email to scribd-platform-developers+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages