How do I know if detectWeb() found that the page should be handled?

12 views
Skip to first unread message

Lennart Borgman

unread,
Jun 30, 2015, 10:18:40 AM6/30/15
to zoter...@googlegroups.com
I thought detectWeb() should return the web page type if the page could be handled by a translator. That does not always seem to be the case. What should I look for?

And how do I collect the results from doWeb()?

I am asking because I am trying to build a bookmarklet to quickly display a reference:

citeproc reference bookmarklet setup https://dl.dropboxusercontent.com/u/848981/it/citep/citeproc-bm-setup.html

Sebastian Karcher

unread,
Jun 30, 2015, 10:27:47 AM6/30/15
to zoter...@googlegroups.com
detectWeb does return the Zotero item type that it expects to import
when doWeb is run, yes. What do you mean by "that does not always seem
to be the case"? It is true that sometimes the actual item type isn't
easily accessible for the detect function (for which we typically won't
make additional Get or Post requests since it runs on every page load)
and then it returns something generic (e.g. a journalAriticle instead of
a bookSection), but a) that's pretty rare and b) not sure how that would
be a problem.
An example would likely help here.
> --
> You received this message because you are subscribed to the Google
> Groups "zotero-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to zotero-dev+...@googlegroups.com
> <mailto:zotero-dev+...@googlegroups.com>.
> To post to this group, send email to zoter...@googlegroups.com
> <mailto:zoter...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/zotero-dev.
> For more options, visit https://groups.google.com/d/optout.

Lennart Borgman

unread,
Jun 30, 2015, 11:15:15 AM6/30/15
to zoter...@googlegroups.com
Thanks adamsmith. I misunderstood something then.

My actual problem now is then that I do not yet understand how to implement Zotero.loadTranslator and Zotero.getTranslatorObject. (I have not found the code currently used in Zotero for those.)

   
Reply all
Reply to author
Forward
0 new messages