javascript - Cannot load oauth.io (oauth.js) in firefox Extension -


i have tried load oauth.io js file downloaded https://github.com/oauth-io/oauth-js/tree/master/dist using

oauth = require("lib/oauth.min.js"); 

i got following error in debug console.

console.error: test:    message: referenceerror: window not defined   stack:     [8]</<@resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/tplib/oauth.min.js:3:20165 [8]<@resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/tplib/oauth.min.js:3:20107 e@resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/tplib/oauth.min.js:3:212 a@resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/tplib/oauth.min.js:3:387 @resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/tplib/oauth.min.js:3:1 cuddlefishloader/options<.load@resource://gre/modules/commonjs/sdk/loader/cuddlefish.js:79:18 background@resource://jid1-rpqb40q3z1iksq-at-jetpack/nekt/lib/background.js:52:10 

please me use oauth.io js file authorize google using oauth.

it looks you're trying load background (main). main in firefox not have window object - why you're getting error. it's fine way of doing things in chrome, background in chrome page , has window element, in firefox though there's no window in background.

if want use js code needs window in main, you'll have follow 1 these routes:

  • edit code not need window element
  • or use page-worker utilize it.

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -