Bug 790659 - JS Error ReferenceError: addon is not defined

- Added check on `test-trusted-document.html` before using `addon` object