Giter Club home page Giter Club logo

Comments (6)

McPo avatar McPo commented on July 29, 2024 7

Thanks a lot for the help. Using the info you provided, I managed to get the script loading without the error messages, while maintaining node integration.

        <script>
            window.nodeRequire = require;
            delete window.require;
        </script>
        <script src="./node_modules/libsignal-protocol/dist/libsignal-protocol.js"></script>
        <script>
            window.require = window.nodeRequire;
            delete window.nodeRequire;
        </script>

I can confirm that it works end to end in electron now.
Again thanks a lot for the tip, it helped immensely.

Electron actually highlights such an issue in their FAQ http://electron.atom.io/docs/faq/.

from libsignal-protocol-javascript.

liliakai avatar liliakai commented on July 29, 2024 2

The droids you are looking for are likely being attached to module.exports instead of window. Someday I hope we'll support a node-compatible build. Until then, you'll have to disable node integration in the renderer if you want to use this libaray as-is.

from libsignal-protocol-javascript.

McPo avatar McPo commented on July 29, 2024

I have created the minimal project required to reproduce the issue.

git clone https://github.com/McPo/electron-quick-start.git
cd electron-quick-start
git checkout libsignal
npm install
npm start

It should take less than a minute to get it up and going.

You should notice the error messages in the console.
However if you open the index.html file in chrome, there should be no error messages.

from libsignal-protocol-javascript.

McPo avatar McPo commented on July 29, 2024

dcodeIO appears to return ByteBuffer in Electron and a Protobuf in Chrome. Hence the undefined Protobuf in Electron. (This may be more relevant for the Electron repo, however I imagine other users would wish to use libsignal within an Electron app).

Electron
image

Chrome
image

from libsignal-protocol-javascript.

bastientanesie avatar bastientanesie commented on July 29, 2024

Thanks @McPo, you just saved me from a night of head-banging ^^'!

from libsignal-protocol-javascript.

marco-fp avatar marco-fp commented on July 29, 2024

Thanks @McPo !

from libsignal-protocol-javascript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.