Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cc['@mozilla.org/network/content-sniffer;1'] is undefined with Nightly 64.0a1 #82

Closed
lidel opened this issue Sep 13, 2018 · 4 comments

Comments

@lidel
Copy link
Contributor

lidel commented Sep 13, 2018

I've noticed a regression when running against latest Nightly (64.0a1):

$ npm run demo:protocol

> [email protected] demo:protocol /home/lidel/project/libdweb
> cross-env MOZ_DISABLE_CONTENT_SANDBOX=1 web-ext run --firefox=nightly --browser-console --url about:debugging --source-dir demo/protocol

Applying config file: ./package.json
Running web extension from /home/lidel/project/libdweb/demo/protocol
Use --verbose or open Tools > Web Developer > Browser Console to see logging

WebExtError: installTemporaryAddon: Error: unknownError: Could not install add-on at '/home/lidel/project/libdweb/demo/protocol': TypeError: Cc['@mozilla.org/network/content-sniffer;1'] is undefined; can't access its "createInstance" property
    at /home/lidel/project/libdweb/node_modules/web-ext/dist/webpack:/src/firefox/remote.js:116:27
    at Client.handleMessage (/home/lidel/project/libdweb/node_modules/web-ext/dist/webpack:/node_modules/@cliqz-oss/firefox-client/lib/client.js:162:1)
    at Client.readMessage (/home/lidel/project/libdweb/node_modules/web-ext/dist/webpack:/node_modules/@cliqz-oss/firefox-client/lib/client.js:221:1)
    at Client.onData (/home/lidel/project/libdweb/node_modules/web-ext/dist/webpack:/node_modules/@cliqz-oss/firefox-client/lib/client.js:187:1)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:601:20)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] demo:protocol: `cross-env MOZ_DISABLE_CONTENT_SANDBOX=1 web-ext run --firefox=nightly --browser-console --url about:debugging --source-dir demo/protocol`
npm ERR! Exit status 1

cc ipfs/ipfs-companion#533

@Gozala
Copy link
Contributor

Gozala commented Sep 13, 2018

It seems that content-sniffer XPCOM registration was removed by Bug 1488306

@Gozala
Copy link
Contributor

Gozala commented Sep 13, 2018

There is still a @mozilla.org/media/sniffer;1 component which actually might work in this instance, but I'm not entirely sure

@lidel
Copy link
Contributor Author

lidel commented Sep 14, 2018

While it would be nice a option to have, now that we have an async handler it is not a hard blocker.
Sniffing can be done in userland (ipfs example).

Worst case scenario: we could just ignore the browser's sniffer entirely and make presence of contentType and contentEncoding mandatory in protocol handler response.

@Gozala
Copy link
Contributor

Gozala commented Sep 14, 2018

Alright this change a78b0a0 puts a band-aid on this, not sure if we'll be able to get content sniffer back, but I'll try.

@Gozala Gozala closed this as completed Sep 14, 2018
lidel added a commit to ipfs/ipfs-companion that referenced this issue Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants