I’ve a problem to get rid of an error, that’s caused by an underlying SDK file.
When I add an “sdk/ui/frame” object to an “sdk/ui/toolbar” object in my add-on this error occurs:
The character encoding of the HTML document was not declared. The
document will render with garbled text in some browser configurations if
the document contains characters from outside the US-ASCII range. The
character encoding of the page must be declared in the document or in
the transfer protocol. view.html
The file “view.html” is located here: “resource://gre/modules/commonjs/sdk/ui/frame/view.html”
And it seems this file is not well declared with full html code and doctype.
How could I prevent this error, because my add-on won’t get a full review with errors.
resource://gre/modules/commonjs/sdk/ui/frame/view.html does not declare the encoding. Since this is part of the SDK and not the addon, it should not affect the review.
<script>
// HACK: This is not an ideal way to deliver chrome messages
// to a innef frame content but seems only way that would
// make `event.source` an this (outer frame) window.
window.onmessage = function(event) {
var frame = document.querySelector("iframe");
var content = frame.contentWindow;
// If message is posted from chrome it has no `event.source`.
if (event.source === null)
content.postMessage(event.data, "*");
};
Possibly, but I’m not an AMO reviewer. You can file a bug against SDK, which is however in maintenance-only mode. It looks like a minor problem in this very case since no non-ASCII characters are involved, so it may not be worth a fix.