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

Webpage extension returns javascript errors #106

Open
MichaelFlinterman opened this issue Jan 19, 2015 · 3 comments
Open

Webpage extension returns javascript errors #106

MichaelFlinterman opened this issue Jan 19, 2015 · 3 comments

Comments

@MichaelFlinterman
Copy link

I have mitro up and running locally with the firefox debug extension, but now I want to try to run the webpage extension. So I start making the extension by make webpage-debug and make webpage-result. The result command doesn' t do anything. It comes back with the following results:

kzjs_srouces = ../api/build/node/lib/node_modules/keyczarjs/.js
forge_srouces = ../api/build/node/lib/node_modules/keyczarjs/node_modules/node-forge/js/
.js
make: Nothing to be done for `webpage-release'.

So, I use webpage-debug. In the docs/webpage.md is documentated how to use the webpage extension. I start the webpage extension by the following command:

python server/server.py --static-root ../build/webpage/debug --port [port-number]

Then I started Google Chrome with the --disable-web-security option. Chrome gives me a statusbar with the message that --disable-web-security is on. I surf to http://:port-number/. I see in my terminal that the server is serving the files. In Chrome I can see the source code, but in the inspector I see the following errors:

prng.js:60 Uncaught TypeError: Cannot read property 'create' of undefined
prng.js:60 prng.create
random.js:72 spawnPrng
random.js:108 (anonymous function)
random.js:183 initModule
random.js:201 (anonymous function)
random.js:237 (anonymous function)

keycache.js:180 Uncaught TypeError: Cannot read property 'seedFileSync' of undefined
keycache.js:180 mitro.keycache.getEntropyBytes
keycache.js:233 mitro.keycache.startFiller
background_api.js:28 (anonymous function)

background.js:35 Uncaught ReferenceError: helpers_background is not defined
background.js:35 (anonymous function)

I tried to debug the errors, but I have no clue where to start or where I can found the errors to fix a solution. Anyone any suggestions how to fix this? Or maybe somebody who already has a working webpage extension? Thanks!

@MichaelFlinterman MichaelFlinterman changed the title Webpage extension return javascript errors Webpage extension returns javascript errors Jan 19, 2015
@winstonhong
Copy link

Hello roeler.

Just "make webpage" instead of "make webpage-release"

$pwd

../mitro/browser-ext/login

$make webpage

$cd build

$pwd
../mitro/browser-ext/login/build

$cd webpage

$ls
release

$cd release

$pwd

../mitro/browser-ext/login/build/webpage/release

$ls
aesCipherSuites.js img pkcs12.js
aes.js index.html pkcs1.js
asn1.js install_redirect.js pkcs7asn1.js
background_api.js jquery.min.js pkcs7.js
background.html js pki.js
background.js jsbn.js prime.worker.js
config.js kew.js prng.js
cookielib.js keycache.js pss.js
crappycrypto.js keycache_webworker.js random.js
crypto.js keyczar.js rc2.js
css keyczar_util.js roundtripper.js
debug.js logging.js rpc.js
des.js loginpage.js rsa.js
domain.js log.js sha1.js
externs_bootstrap.js lru_cache.js sha256.js
externs_jasmine.js md5.js socket.js
externs_jquery.js md.js ssh.js
externs_jsunit.js mgf1.js task.js
externs_underscore.js mgf.js testkeys.js
externs_web.js mitroclient.js test_util.js
fonts mitro_fe.js tls.js
forge.js mitro.js tlssocket.js
form.js mitro_legacyapi.js URI.js
helpers_background.js mitro_lib.js util.js
helpers_common.js oids.js utils.js
helpers.js password_generator.js worker.js
hmac.js pbe.js x509.js
html pbkdf2.js xhr.js
http.js pem.js

$cd ../../..

$pwd
../mitro/browser-ext/login

$python server/server.py --static-root ../build/webpage/release --port 8090

Then we use FireFox to access

http://localhost:8090/

A Mitro background webpage is shown up

Indeed the server is running index.html as shown in the following link.

https://github.com/mitro-co/mitro/tree/master/browser-ext/login/webpage

I have enabled two-factor authentication of Mitro. However, I can use username and password to login Mitro directly without any popup information on 6-digits two-factor authentication code.

Would you please shed me some light on how to make 6-digits two-factor authentication show up if you have some ideas?

Thank you very much.

@MichaelFlinterman
Copy link
Author

Thank you for your info. I build with success an webpage-released extension, but still having the same errors that I mentioned earlier. Still working on it, but I have no clue where to start. Still hoping that someone could set me on track with this issue.

I have enabled 2FA by default as soon as I had the extension running (both chrome and firefox). I tested it with a second machine and everything worked fine for me.

@winstonhong
Copy link

Hello roeler.

Loading popup.html would load 22 javascripts to manipulate the sign-in process, as shown in the source code.

https://github.com/mitro-co/mitro/blob/master/browser-ext/login/frontend/templates/popup.mustache

Such "CPU-intensive" loading task may tear down the server during the peak hour if webpage-released extension is used for sign-in.

Therefore, Mitro client is suggested to run on the local machine using web browser extension.

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