GithubHelp home page GithubHelp logo

mozilla-b2g / firefoxos-loop-client Goto Github PK

View Code? Open in Web Editor NEW
28.0 98.0 44.0 17.52 MB

DEPRECATED - Firefox OS client for the Loop service

License: Apache License 2.0

JavaScript 88.38% HTML 2.13% CSS 9.28% Java 0.21%
abandoned unmaintained

firefoxos-loop-client's Introduction

Firefox OS Loop Client

Build Status

Firefox OS client for the Loop service

Want to contribute?

Grunt

We rely on Grunt for performing repetetive task such as unit testing, linting, building and pushing the app onto the device. If this is the first time you clone the app you must install all the Grunt stuff. Grunt and Grunt plugins are installed and managed via npm, the Node.js package manager (so we would need to install Node.js as well).

If you already have Node.js and Grunt you just need to install the Grunt plugins we use. Please proceed as follow:

  $ npm install

At the moment we have a few Grunt tasks. Let's see them.

build

  $ grunt build

This the one a regular dev, user, tester o QA guy should use. It builds the app and push it onto the device (no WebIDE usage is involved).

release

  $ grunt release

This is the task that builds the app for releasing it.

test

  $ grunt test

This is the task we have for unit testing. It launches tests in shell with PhantomJS.

To add a new test, you only have to write the test (and add it somewhere under the test/ directory, preferably on test/unit) and then add a new .html file to test/test_scripts. That file should have the <script> tags to load your unit test and any other script file you need (like the one you're actually testing).

More notes about testing. We're using SlimerJS and grunt-mocha-slimerjs for testing. The Spec reporter (as set by default) do not log errors or stack traces on failures. So if you want to see the errors (and believe me, you will) then you need to specify the JSON reporter. The easiest way to do this is with:

  grunt test --testReporter=JSON

If you want to run only the test contained on test_name.js, execute:

  grunt test --testFile=name

e.g. to run only the test in test_join_room.js:

  grunt test --testFile=join_room

Grunt options

There are many flags that allow you to configure different parameters of the generated Loop Applications.

loopVersion

Replaces the loop version in both manifest.webapp and config.js with the string passed as parameter, e.g.

$ grunt build --loopVersion=2.2

configures loop version to 2.2. Please do not use this parameter unless you really need as otherwise it might interfere with Loop Production metrics.

loopServer

Configures the Loop server to be used.

You can use one of the pre-defined servers, where possible values are production|stage|development. Alternatively you can pass a full URL (including the protocol e.g. https://myloopserver.com).

This changes the server in the config.js and the origin in the manifest.webapp file.

E.g. for a predefined server.

$ grunt build --loopServer=production

E.g. for a custom server.

$ grunt build --loopServer=https://myloopserver.com

Please note that although the use of encryption is encouraged, the tool allows using servers using plain http. If an http server is used, the allowUnsecure parameter will be set to true in the application config.js.

enforceDevices

When setting this to true, only compatible/tested devices (Fire E) are allowed to use the app. When setting this to false, any device is allowed. E.g.

$ grunt build --enforceDevices=true

Using this option modifies the compatiblity.json file as required.

debug

When setting this to true, debug mode is enabled so logs are shown in the logcat. This modifies the parameter in config.js. E.g.

$ grunt build --debug=true
metrics

Configures if metrics are reported and to which server. Possible values are production|stage|disabled.

  • production: metrics are enabled and production server for input.mozilla is used.
  • stage: metrics are enabled and stage server for input.mozilla is used.
  • disabled: metrics are disabled
This parameter changes the related attributes in config.js. Please note that telemetry is always using the production server and the only way to distinguish production from development data is by the version sent (read from config.js). ``` $ grunt build --metrics=production ``` ##### performanceLog

Configures if performance metrics for set-up time are taken. Possible values are persistent|enabled|disabled.

  • persistent: performance is measured and logs saved in SDCard.
  • enabled: performance is measured and logs shown in logcat.
  • disabled: performance is not measured.
E.g. ``` $ grunt build --performanceLog=disabled ``` #### Special releases and builds

Additionally, a couple of extra tasks have been added to make easier the generation of builds for development or publication purposes:

releaseProduction and buildProduction
$ grunt releaseProduction
$ grunt buildProduction

Releases a build or creates it and pushes it to a device with the following options:

  • --deviceCompatibility=true
  • --debug=false
  • --loopServer=production
  • --performanceLog=disabled
  • --metrics=production
##### releaseDevelopment and buildDevelopment
$ grunt releaseDevelopment
$ grunt buildDevelopment

Releases a build or creates it and pushes it to a device with the following options:

  • --deviceCompatibility=false
  • --debug=true
  • --loopServer=development
  • --performanceLog=persistent
  • --metrics=stage

firefoxos-loop-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

firefoxos-loop-client's Issues

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please see Mozilla-GitHub-Standards or email [email protected].

(Message COC001)

Audio not working

Audio is not working while calling someone using Firefox OS client. All ok from a pc, so the client send both audio and video, but receives only video

ReferenceError: Version is not defined

W/Firefox Hello( 3018): [JavaScript Error: "ReferenceError: Version is not defined" {file: app://loop.services.mozilla.com/js/screens/settings.js" line: 215}]
#294 is probably because of this.

msisdn auth isn't working

  1. flash b2g 2.0 branch to Flame device with SIM card
  2. use app-manager to install this app
  3. launch Loop, swipe to the right till "Let's start"
  4. tap to share
  5. tap 'use phone number'
  6. click share on phone number

actual: 'connecting' just spins, if you click 'X' to close, you see authenticating spinner

I set these gecko prefs:
user_pref("identity.fxaccounts.loglevel", "TRACE");
user_pref("services.mobileid.loglevel", "TRACE");

the only thing i saw in my logcat was:

E/GeckoConsole( 8454): [JavaScript Warning: "Invalid URI. Load of media resource  failed." {file: "app://loop.dev.mozaws.net/index.html" line: 0}]
E/GeckoConsole( 8454): [JavaScript Warning: "Error in parsing value for 'box-sizing'.  Declaration dropped." {file: "app://loop.dev.mozaws.net/style/calllog.css" line: 79 column: 14 source: "  box-sizing: boder-box;"}]
I/Gonk    ( 1364): Setting nice for pid 1627 to 18
I/Gonk    ( 1364): Changed nice for pid 1627 from 1 to 18.
E/GeckoConsole( 8454): [JavaScript Warning: "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help http://xhr.spec.whatwg.org/" {file: "app://loop.dev.mozaws.net/libs/l10n.js" line: 309}]
E/Sensors ( 1364): change G sensor state "0 -> 1"
E/GeckoConsole( 8454): Content JS LOG at app://loop.dev.mozaws.net/js/helpers/account_helper.js:197 in init/<: Account null
E/GeckoConsole( 8454): Content JS LOG at app://loop.dev.mozaws.net/js/helpers/account_helper.js:203 in init/<: First run

How to add section of Firefox Hello into contacts

Hello, I know that it is just a question and not a bug so I'm sorry if I'm using uncorrectly the bug tracker.
I installed Firefox Hello on my Flame and I saw that in every contact there is a section named "Firefox Hello" and two buttons, "Audio" and "Video".
Where can I find in the docs how to add such buttons in the contact and where can I find the code on firefoxos-loop-client about this feature?
Thank you very much!

Marketplace version fails with "device not compatible" on FirefoxOS nightly

Problem

On my Flame device with FirefoxOS Nightly, launching the client tells me "Sorry, your device isn't compatible with this app". This is the marketplace version of the Firefox Hello client which https://hello.firefox.com/<room-id> redirected me to when trying to join a room.

After some looking around, it seems the version I'm running (marketplace version, so I guess the unmodified production version?) only has "ALCATELOneTouch6015X" in the devices list of compatibility.json and no "Mozilla" item (this makes sense with the production configuration).

Now after following MDN's Flame update guide (flashing the base image and activating the nightly updates), FirefoxOS Nightly's UA string is Mozilla/5.0 (Mobile; rv:40.0) Gecko/40.0 Firefox/40.0. I understand this can be changed back to "Mozilla/5.0 (Mobile; ALCATELOneTouch4012X; rv:40.0) Gecko/40.0 Firefox/40.0" by setting the general.useragent.device_id pref, but as things are now the compatibility check fails here.

Solutions?

Can you detect you're on a Flame device without asking FFOS Nightly users to add "ALCATELOneTouch6015X" to their UA string? (also since MDN mentions Mozilla discourages using device-specific UA strings)

Couldn't sign in by using my flame 3.0 nightly

index

I just pushed the firefox hello app into my flame (running 3.0 nightly). I tried with both firefox account and phone number for sign in into the Hello. But It showing like in the screenshot that I attached here.
I waited there actually for 20 minutes, But no positive result.... :(

grunt build tasks fail

All grunt build tasks fail with the following error message:

Warning: Cannot find module 'es6-Promise' Use --force to continue.

I tried to do npm install es6-promise but it didn't help.
I can still flash my phone using the WebIDE.

can't login on 2.1

hello,
I just cloned the source, build it with grunt release and flashed the application zip via the WebIDE. But I can't log in. When I choose Firefox account I get an error "this shouldn't have been happen, try again later." and when I choose Phone number, I can select my number and receive a sms, but it keeps saying connecting and times out after a few minutes. It only says "there is a problem with your verification code".

A few JavaScript issues being reported by ESLint

Ran ESLint against the repo and it returned a few errors and possible jsdoc issues:

$ ./node_modules/.bin/eslint firefoxos-loop-client/

/js/account.js

LINE:COL TYPE MESSAGE RULE
37:2 error Missing JSDoc @returns for function valid-jsdoc
37:2 error Missing JSDoc for parameter 'identifier' valid-jsdoc
37:2 error Missing JSDoc for parameter 'credentials' valid-jsdoc

/js/account_helper.js

LINE:COL TYPE MESSAGE RULE
18:4 error Missing JSDoc @returns for function valid-jsdoc
50:8 warning Unexpected todo comment no-warning-comments
29:4 error Missing JSDoc @returns for function valid-jsdoc
92:4 error Missing JSDoc @returns for function valid-jsdoc
139:8 warning Unexpected todo comment no-warning-comments
130:4 error Missing JSDoc @returns for function valid-jsdoc
130:4 error Missing JSDoc for parameter 'onlogout' valid-jsdoc

/js/account_storage.js

LINE:COL TYPE MESSAGE RULE
20:4 error Missing JSDoc @returns for function valid-jsdoc
20:4 error Expected JSDoc for 'onsuccess' but found 'success' valid-jsdoc
43:4 error Missing JSDoc @returns for function valid-jsdoc
58:4 error Missing JSDoc @returns for function valid-jsdoc

/js/call_helper.js

LINE:COL TYPE MESSAGE RULE
17:2 error Missing JSDoc @returns for function valid-jsdoc
62:4 error Missing JSDoc @returns for function valid-jsdoc
72:4 error Missing JSDoc @returns for function valid-jsdoc
94:4 error Missing JSDoc @returns for function valid-jsdoc
127:4 error Missing JSDoc @returns for function valid-jsdoc

/js/client_request_helper.js

LINE:COL TYPE MESSAGE RULE
87:10 error 'deriveHawkCredentials' is not defined no-undef

/js/controller.js

LINE:COL TYPE MESSAGE RULE
43:10 warning Unexpected todo comment no-warning-comments
23:2 error Missing JSDoc @returns for function valid-jsdoc
58:4 error Missing JSDoc @returns for function valid-jsdoc
99:26 warning Empty block statement no-empty
118:8 warning Unexpected todo comment no-warning-comments
123:8 warning Unexpected todo comment no-warning-comments
79:4 error Missing JSDoc @returns for function valid-jsdoc
132:4 error Missing JSDoc @returns for function valid-jsdoc
151:4 error Missing JSDoc @returns for function valid-jsdoc
179:4 error Missing JSDoc @returns for function valid-jsdoc
98:10 warning onLogin is defined but never used no-unused-vars

/js/fxac_helper.js

LINE:COL TYPE MESSAGE RULE
10:4 error Missing JSDoc @returns for function valid-jsdoc
27:4 error Missing JSDoc @returns for function valid-jsdoc
34:4 error Missing JSDoc @returns for function valid-jsdoc
18:10 warning that is defined but never used no-unused-vars

/js/opentok.js

LINE:COL TYPE MESSAGE RULE
18:6 error Missing JSDoc @returns for function valid-jsdoc
18:6 error Missing JSDoc for parameter 'ignoredConstraints' valid-jsdoc
18:6 error Missing JSDoc for parameter 'onsuccess' valid-jsdoc
18:6 error Missing JSDoc for parameter 'onerror' valid-jsdoc
12:4 error Missing JSDoc @returns for function valid-jsdoc

/js/simple_push_helper.js

LINE:COL TYPE MESSAGE RULE
22:41 error Unexpected token =

/js/ui.js

LINE:COL TYPE MESSAGE RULE
30:4 error Missing JSDoc @returns for function valid-jsdoc
30:4 error Missing JSDoc for parameter 'oninit' valid-jsdoc
44:4 error Missing JSDoc @returns for function valid-jsdoc
78:4 error Missing JSDoc @returns for function valid-jsdoc
105:4 error Missing JSDoc @returns for function valid-jsdoc
136:4 error Missing JSDoc @returns for function valid-jsdoc
172:4 error Missing JSDoc @returns for function valid-jsdoc
172:4 error Expected JSDoc for 'onhangup' but found 'onhanup' valid-jsdoc
198:4 error Missing JSDoc @returns for function valid-jsdoc
220:4 error Missing JSDoc @returns for function valid-jsdoc
33:27 warning oninit is defined but never used no-unused-vars

/js/utils.js

LINE:COL TYPE MESSAGE RULE
35:6 warning Unexpected todo comment no-warning-comments
61:6 error Expected an assignment or function call and instead saw an expression no-unused-expressions
55:4 error Missing JSDoc @returns for function valid-jsdoc
34:42 warning id is defined but never used no-unused-vars

/test/unit/client_request_helper_test.js

LINE:COL TYPE MESSAGE RULE
150:30 warning response is defined but never used no-unused-vars
188:30 warning response is defined but never used no-unused-vars

/test/unit/mock_async_storage.js

LINE:COL TYPE MESSAGE RULE
12:20 warning key is defined but never used no-unused-vars
12:25 warning value is defined but never used no-unused-vars

/test/unit/mock_tb_publisher.v2.2.3.1.js

LINE:COL TYPE MESSAGE RULE
22:33 error Expected '===' and instead saw '==' eqeqeq
16:21 warning targetElement is defined but never used no-unused-vars
16:36 warning properties is defined but never used no-unused-vars

/test/unit/mock_tb_session.v2.2.3.1.js

LINE:COL TYPE MESSAGE RULE
75:50 warning Empty block statement no-empty
99:59 warning completionHandler is defined but never used no-unused-vars
99:47 warning properties is defined but never used no-unused-vars
99:24 warning stream is defined but never used no-unused-vars
99:32 warning targetElement is defined but never used no-unused-vars

/test/unit/mock_xmlhttprequest.js

LINE:COL TYPE MESSAGE RULE
1:0 warning Unexpected xxx comment no-warning-comments
42:4 error Expected an assignment or function call and instead saw an expression no-unused-expressions
55:6 error Expected an assignment or function call and instead saw an expression no-unused-expressions
66:6 error Expected an assignment or function call and instead saw an expression no-unused-expressions
80:43 error Unnecessary semicolon no-extra-semi
90:43 error Trailing comma no-comma-dangle

/test/unit/simple_push_helper_test.js

LINE:COL TYPE MESSAGE RULE
83:21 warning ['foo'] is better written in dot notation dot-notation
130:60 warning error is defined but never used no-unused-vars
130:67 warning endpoint is defined but never used no-unused-vars

โœ– 77 problems

Orientation on tablets

Firefox Hello client is hardcoded to be orientated in portrait mode, that it could be uncomfortable on tablets

Add Flame to the compatibiliy.json list.

Hi there,

I am @CodingFree, Marketplace App Reviewer. Could be added the Flame device into the compatibility.json list? If it can't be added, we are wondering at the Reviewer Team why not.

We are trying to test it in Flame because it is the Mozilla's Firefox OS reference device

Can't share links with a contact

Not sure if I'm just doing it wrong (Firefox OS 2.2, current tip of master).

I open the app, go in the "Shared links" panel, select a contact. App always tries to make a call, even with a new contact that only has email address set.

FTBFS

With the current master (c45dec7), I get this:


matej@mitmanek: firefoxos-loop-client (master)$ grunt build
Running "clean:server" (clean) task
>> 0 paths cleaned.

Running "clean:postTest" (clean) task
>> 11 paths cleaned.

Running "clean:app" (clean) task
>> 0 paths cleaned.

Running "bower:install" (bower) task
>> Installed bower packages

Running "copy:build" (copy) task
Created 69 directories, copied 537 files

Running "configure" task

Running "gitinfo" task

Running "writeVersionFile" task

Running "compress:release" (compress) task
Created application.zip (6841530 bytes)

Running "ffosstop:app" (ffosstop) task
Starting interaction with the device, please accept the prompts on it (if any)
You can disable the prompts in the device by setting the property devtools.debugger.prompt-connection to false
Warning: Cannot find module 'es6-Promise' Use --force to continue.

Aborted due to warnings.
matej@mitmanek: firefoxos-loop-client (master)$ 

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.