mirror of
https://github.com/zotero/zotero.git
synced 2026-10-11 03:38:25 +00:00
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
85b5e3fc84
commit
b82eb77b70
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…
Add table
Reference in a new issue