Scaffold: Non-async detectWeb and async scrape by default
We don't usually want an async detectWeb, since HTTP requests should only be used there in very exceptional cases. We do usually want an async scrape (and we were already - mistakenly - awaiting it).
This commit is contained in:
parent
5a8b5a1829
commit
96c4427d6c
1 changed files with 3 additions and 3 deletions
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
async function detectWeb(doc, url) {
|
||||
function detectWeb(doc, url) {
|
||||
// TODO: adjust the logic here
|
||||
if ($$CURSOR$$url.includes('/article/')) {
|
||||
return 'newspaperArticle';
|
||||
|
@ -52,7 +52,7 @@ function getSearchResults(doc, checkOnly) {
|
|||
}
|
||||
|
||||
async function doWeb(doc, url) {
|
||||
if (await detectWeb(doc, url) == 'multiple') {
|
||||
if (detectWeb(doc, url) == 'multiple') {
|
||||
let items = await Zotero.selectItems(getSearchResults(doc, false));
|
||||
if (items) {
|
||||
await Promise.all(
|
||||
|
@ -66,7 +66,7 @@ async function doWeb(doc, url) {
|
|||
}
|
||||
}
|
||||
|
||||
function scrape(doc, url = doc.location.href) {
|
||||
async function scrape(doc, url = doc.location.href) {
|
||||
// TODO: implement or add a scrape function template
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue