[Solved]Problem with function detectWeb

Hi everybody,

my function detectWeb seem like this :


function detectWeb(doc, url) {
if (url.match("id=") && url.match("ead.html")) return "book";
else if (url.match("base=ead") && url.match("results.html")) return "multiple";
else if (url.match("list-results.html") && url.match("mode=")) return "multiple";
}

the first if work nice,
the first else if work nice,
the second else if work correctly with scaffold (the page is matched and i scrape that i want); but firefox wan't not match it. The yellow icon (for multiple) never appear !!!
Did some know what's the problem.

Thank you for you help.
  • Are you sure that your translator target is matching the page? There's no difference in the execution environment between Scaffold and Firefox. If you're still having trouble, it might be worth posting your entire translator to zotero-dev.
  • it work !

    The problem was a difference of target between function detectweb and the target fields of the header translator.
    I want to notice that, with that simple exemple we can make a "difference of execution between Scaffold and Firefox". Is it normal or a bug ?

    Best regard.
  • It's intended. Scaffold doesn't check the target regexp on detect; it only checks it if you click the "Test Regex" button.

This is an old discussion that has not been active in a long time. Instead of commenting here, you should start a new discussion. If you think the content of this discussion is still relevant, you can link to it from your new discussion.