Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #480 from ochameau/bug/769483-nsIDOMParser-exception
Browse files Browse the repository at this point in the history
Bug 769483: Fix exception when using data:URI documents instanciated with nsIDOMParser. r=@Gozala
  • Loading branch information
ochameau committed Jul 25, 2012
2 parents 3ac1e78 + c3f1ff0 commit 3d4b983
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/api-utils/lib/l10n/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ function onContentWindow(event) {
if (!(document instanceof Ci.nsIDOMHTMLDocument))
return;

// Bug 769483: data:URI documents instanciated with nsIDOMParser
// have a null `location` attribute at this time
if (!document.location)
return;

// Accept only document from this addon
if (document.location.href.indexOf(assetsURI) !== 0)
return;
Expand Down

0 comments on commit 3d4b983

Please sign in to comment.