我正在尝试从引用构建一个html页面的ocr http://progur.com/2016/10/how-to-use-tesseract-for-ocr-javascript.html
我做的是
<html>
<head>
<script src="https://cdn.rawgit.com/naptha/tesseract.js/0.2.0/dist/tesseract.js">
</script>
</head>
<body>
<input type="text" id="url" placeholder="Image URL" />
<input type="button" id="go_button" value="Run" />
<div id="ocr_results"> </div>
<div id="ocr_status"> </div>
</body>
<script>function runOCR(url) {
console.log("running")
Tesseract.recognize(url)
.then(function(result) {
document.getElementById("ocr_results")
.innerText = result.text;
}).progress(function(result) {
document.getElementById("ocr_status")
.innerText = result["status"] + " (" +
(result["progress"] * 100) + "%)";
});
}
document.getElementById("go_button")
.addEventListener("click", function(e) {
var url = document.getElementById("url").value;
runOCR(url);
});
但我正在说一些错误
worker.js:2610未捕获的DOMException:无法执行&#39; open&#39; on&#39; IDBFactory&#39 ;:在此上下文中拒绝访问索引数据库API。
我在做错了什么?我该怎么做才能让它发挥作用?