Skip to content

Update browser detection#50

Closed
bhamodi wants to merge 4 commits intogabceb:masterfrom
bhamodi:update-browser-detection
Closed

Update browser detection#50
bhamodi wants to merge 4 commits intogabceb:masterfrom
bhamodi:update-browser-detection

Conversation

@bhamodi
Copy link
Contributor

@bhamodi bhamodi commented Nov 23, 2014

This PR updates browser detection to support iPod, Kindle and BlackBerry devices.
This PR also includes corresponding unit tests and updates the README. 👍

@gabceb @le717

@le717
Copy link
Contributor

le717 commented Nov 23, 2014

Will look over this one last time tomorrow.

@le717 le717 self-assigned this Nov 23, 2014
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove "in addition to desktop and mobile browsers"?

@le717
Copy link
Contributor

le717 commented Nov 24, 2014

Ouch, I'm getting a lot of test failures with this, in both the existing tests and the new ones. :( Have you run the tests on your computer and pass for you? I have a feeling it is caused by alphabetizing the match and platform_match statements, but not sure.

@bhamodi
Copy link
Contributor Author

bhamodi commented Nov 24, 2014

Oh no. 😞
Can you teach me how to run the tests locally? I have not done that yet. This will help me with the debugging process.

@le717
Copy link
Contributor

le717 commented Dec 5, 2014

@bhamodi Sorry for the late reply, I was slammed by finals and the semester ending.

I assume you are running Windows, but if you are not, @gabceb will have to fill you in on the steps required.

  1. Download and install Node.js
  2. Download PhantomJS and copy the .exe to the same folder as Gruntfile.js.
  3. Once Node is installed, open a command window in the same folder as the .exe and run npm install. This may take a short bit.
  4. When that is done, run grunt test and watch the output for errors.

That command also minifies the script and copies it from dist/ to test/src/. Be sure not to edit these or include them in your finals.

@bhamodi
Copy link
Contributor Author

bhamodi commented Dec 9, 2014

@le717 - Thanks for the steps! (Also I hope your finals went well 😄). So I just set up my local environment and was able to test locally. All tests passed without any errors. I guess you were getting lots of errors because I didn't run the tests locally and include the minified js files. This PR should be good to go now! 👍

@le717
Copy link
Contributor

le717 commented Dec 9, 2014

What OS are you running? I'm curious as to why they passed on your Windows machine but not mine (Windows 8).

P.S. I'm sure it was not the lack of the files in your newest commit. Those are automatically generated when the tests are run.

@bhamodi
Copy link
Contributor Author

bhamodi commented Dec 9, 2014

Windows 7, 64 bit.

@bhamodi
Copy link
Contributor Author

bhamodi commented Dec 10, 2014

BTW, the steps you outlined above to run tests didn't work for me 100%.
To get the command grunt test to work for me I add to globally install casperjs, grunt-cli and phantomjs by running these commands:

npm install -g grunt-cli
npm install -g casperjs
npm install -g phantomjs

Can you try to update your casperjs, phantomjs and grunt-cli and then retest?

@le717
Copy link
Contributor

le717 commented Dec 11, 2014

I will as soon as I can. I had to redo my laptop, but it is taking longer than expected. I plan is to merge this then tag a v0.0.7 release because of all the changes.

My finals went well, thank you. :)

@bhamodi
Copy link
Contributor Author

bhamodi commented Dec 11, 2014

Sounds good. :)

@le717
Copy link
Contributor

le717 commented Dec 12, 2014

I just ran those commands, and it is still failing, and I think I know why. It's because of the alphabetized match and/or platform_match lists. For example: the windows phone "is mobile" test is failing. Manual testing is showing that as being labeled as a desktop browser. Inspection finds that platform_match is matching win and immediately returning true, so windows phone is never checked. In effect, it identifies Windows Phone IE as normal IE. Moving windows phone above win makes it work again.

So those two parts are going to need reverted back to you initially added them in bhamodi@37eb49f (the ordering and new additions, that is, not reverting the previous changes). Also, if you remove, please remove the minified and test/src files, as those will be generated upon release. :)

@bhamodi
Copy link
Contributor Author

bhamodi commented Dec 12, 2014

Oh... interesting. Not sure why mine keeps passing haha. I'll go ahead and fix that now.

@le717
Copy link
Contributor

le717 commented Dec 12, 2014

*sigh* OK, the issues go deeper than I first thought. I have cherry-picked your commit and added the fixes over on bhamodi-new-browsers. If that looks good to you (and the tests pass), I'll close this one and merge that branch (which, as you will see, does contain your commit).

@le717 le717 mentioned this pull request Dec 12, 2014
@le717 le717 closed this Dec 12, 2014
@le717
Copy link
Contributor

le717 commented Dec 12, 2014

Superseded by #52.

@bhamodi bhamodi deleted the update-browser-detection branch December 12, 2014 19:28
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

Successfully merging this pull request may close these issues.

2 participants