在Firefox中使用Word Online时,之后插入文本时,insertInlinePictureFromBase64有时会引发错误。
当我使用.debug.js文件时,似乎在更大的图像上更经常发生该错误。
插入代码:
Word.run(function (ctx) {
var base64 = "<a_base64_string_with_jpeg_image_data>"; // mine has about 80 KB
ctx.document.getSelection().insertInlinePictureFromBase64(base64, "End");
ctx.document.getSelection().insertText("\n", "End"); // without this line it works fine
ctx.document.getSelection().select("End");
ctx.sync();
});
堆栈:
RuntimeError@https://appsforoffice.microsoft.com/lib/1/hosted/word-web-16.00.debug.js:11181:15
ClientRequestContext.prototype.processRequestExecutorResponseMessage@https://appsforoffice.microsoft.com/lib/1/hosted/word-web-16.00.debug.js:13731:12
ClientRequestContext.prototype.syncPrivate/<@https://appsforoffice.microsoft.com/lib/1/hosted/word-web-16.00.debug.js:13638:23