michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: importScripts("JSDOMParser.js", "Readability.js"); michael@0: michael@0: self.onmessage = function (msg) { michael@0: let uri = msg.data.uri; michael@0: let doc = new JSDOMParser().parse(msg.data.doc); michael@0: let article = new Readability(uri, doc).parse(); michael@0: postMessage(article); michael@0: };