summaryrefslogtreecommitdiff
path: root/ext/bg/js/audio-downloader.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/audio-downloader.js')
-rw-r--r--ext/bg/js/audio-downloader.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/bg/js/audio-downloader.js b/ext/bg/js/audio-downloader.js
index 839eab7b..d1c4a02e 100644
--- a/ext/bg/js/audio-downloader.js
+++ b/ext/bg/js/audio-downloader.js
@@ -17,6 +17,7 @@
/* global
* NativeSimpleDOMParser
+ * SimpleDOMParser
*/
class AudioDownloader {
@@ -239,8 +240,10 @@ class AudioDownloader {
}
_createSimpleDOMParser(content) {
- if (NativeSimpleDOMParser.isSupported()) {
+ if (typeof NativeSimpleDOMParser !== 'undefined' && NativeSimpleDOMParser.isSupported()) {
return new NativeSimpleDOMParser(content);
+ } else if (typeof SimpleDOMParser !== 'undefined' && SimpleDOMParser.isSupported()) {
+ return new SimpleDOMParser(content);
} else {
throw new Error('DOM parsing not supported');
}