Skip to content

Instantly share code, notes, and snippets.

View alexgibson's full-sized avatar
🍄
1UP

Alex Gibson alexgibson

🍄
1UP
View GitHub Profile
function isWin10S() {
try {
var mode = JSON.parse(window.external.getHostEnvironmentValue('os-mode'));
if (mode && mode['os-mode'] === '2') {
return true;
}
return false;
} catch(e) {
return false;
}
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
async function handleRequest(request) {
// The % of traffic we want to redirect (e.g. 0.05 == 5%)
const SAMPLE_RATE = 0.05;
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from pages.base import BasePage
from pages.regions.download_button import DownloadButton
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from pages.home import HomePage
@pytest.mark.skip_if_firefox(reason='Download button is displayed only to non-Firefox users')

Today marks my fifth year working for Mozilla! This past year has been both fun and frantic, and overall was a really good year for both Mozilla and Firefox. Here's a run down of some of the things I worked on in the past year.

Firefox Quantum launch

In November we shipped one of Firefox's biggest updates ever, called Firefox Quantum. It was a huge update that took a ton of work, and the sucessful launch was a real focused effort from many different teams across the organisation. In all my time at Mozilla, I don't think I've ever seen such a combined focus in imporving our core product and getting our message across loud and clear that Firefox is fast again. My own contribution was building some of the main download pages that marketing used for the Firefox Quantum launch campaign.

Mozilla rebranding

@alexgibson
alexgibson / home.py
Last active November 21, 2016 18:10
_take_over_locator = (By.ID, 'fundraising_takeover')
_take_over_close_button_locator = (By.ID, 'close_takeover')
@property
def is_take_over_displayed(self):
return self.is_element_displayed(*self._take_over_locator)
# EOY fundraising takeover https://bugzilla.mozilla.org/show_bug.cgi?id=1316375
def wait_for_page_to_load(self):
super(BasePage, self).wait_for_page_to_load()
#!/bin/bash
source venv/bin/activate
python manage.py runserver 0.0.0.0:8000
WARN [watcher]: Pattern "/Users/agibson/Sites/bedrock/media/js/firefox/os/mwv-2015-preview.js" does not match any file.
INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
INFO [launcher]: Starting browser Firefox
INFO [Firefox 39.0.0 (Mac OS X 10.10.0)]: Connected on socket rJ1U32LPCiH1Lr5mv6rg with id 11873347
.............................
Firefox 39.0.0 (Mac OS X 10.10.0) ERROR
TypeError: pager is undefined
at /Users/agibson/Sites/bedrock/media/js/firefox/channel.js:28
Firefox 39.0.0 (Mac OS X 10.10.0): Executed 29 of 233 ERROR (0.049 secs / 0.032 secs)
Warning: Task "karma:unit" failed. Use --force to continue.
".source.js":
"Casperjs Skeleton":
"prefix": "casper-init"
"body": """
/* This Source Code Form is subject to the terms of the Mozilla Public" + '/n' +
"* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* global casper */
'use strict';
casper.test.begin('Firefox Sync, Firefox on Android: ' + url, 1, function suite(test) {
casper.userAgent('Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0');
casper.start();
casper.thenOpen(url, function() {
test.assertVisible('.primary .show-fx-android.instructions', 'Fx on Android instructions shown');
});