Rename SimpleDOMParser to NativeSimpleDOMParser (#1113)
This commit is contained in:
parent
e29c752793
commit
7926821c48
@ -39,7 +39,7 @@
|
|||||||
<script src="/bg/js/options.js"></script>
|
<script src="/bg/js/options.js"></script>
|
||||||
<script src="/bg/js/profile-conditions.js"></script>
|
<script src="/bg/js/profile-conditions.js"></script>
|
||||||
<script src="/bg/js/request-builder.js"></script>
|
<script src="/bg/js/request-builder.js"></script>
|
||||||
<script src="/bg/js/simple-dom-parser.js"></script>
|
<script src="/bg/js/native-simple-dom-parser.js"></script>
|
||||||
<script src="/bg/js/text-source-map.js"></script>
|
<script src="/bg/js/text-source-map.js"></script>
|
||||||
<script src="/bg/js/translator.js"></script>
|
<script src="/bg/js/translator.js"></script>
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* global
|
/* global
|
||||||
* SimpleDOMParser
|
* NativeSimpleDOMParser
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AudioDownloader {
|
class AudioDownloader {
|
||||||
@ -109,7 +109,7 @@ class AudioDownloader {
|
|||||||
});
|
});
|
||||||
const responseText = await response.text();
|
const responseText = await response.text();
|
||||||
|
|
||||||
const dom = new SimpleDOMParser(responseText);
|
const dom = new NativeSimpleDOMParser(responseText);
|
||||||
for (const row of dom.getElementsByClassName('dc-result-row')) {
|
for (const row of dom.getElementsByClassName('dc-result-row')) {
|
||||||
try {
|
try {
|
||||||
const audio = dom.getElementByTagName('audio', row);
|
const audio = dom.getElementByTagName('audio', row);
|
||||||
@ -149,7 +149,7 @@ class AudioDownloader {
|
|||||||
});
|
});
|
||||||
const responseText = await response.text();
|
const responseText = await response.text();
|
||||||
|
|
||||||
const dom = new SimpleDOMParser(responseText);
|
const dom = new NativeSimpleDOMParser(responseText);
|
||||||
try {
|
try {
|
||||||
const audio = dom.getElementById(`audio_${expression}:${reading}`);
|
const audio = dom.getElementById(`audio_${expression}:${reading}`);
|
||||||
if (audio !== null) {
|
if (audio !== null) {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SimpleDOMParser {
|
class NativeSimpleDOMParser {
|
||||||
constructor(content) {
|
constructor(content) {
|
||||||
this._document = new DOMParser().parseFromString(content, 'text/html');
|
this._document = new DOMParser().parseFromString(content, 'text/html');
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user