Commit 539ce013 authored by Sean Hammond's avatar Sean Hammond Committed by GitHub

Merge pull request #460 from hypothesis/ff-startup-fix

Fix sidebar app failing to load in Firefox extension.
parents d451b587 90927d28
...@@ -225,5 +225,16 @@ module.exports = angular.module('h', [ ...@@ -225,5 +225,16 @@ module.exports = angular.module('h', [
processAppOpts(); processAppOpts();
// Work around a check in Angular's $sniffer service that causes it to
// incorrectly determine that Firefox extensions are Chrome Packaged Apps which
// do not support the HTML 5 History API. This results Angular redirecting the
// browser on startup and thus the app fails to load.
// See https://github.com/angular/angular.js/blob/a03b75c6a812fcc2f616fc05c0f1710e03fca8e9/src/ng/sniffer.js#L30
if (window.chrome && !window.chrome.app) {
window.chrome.app = {
dummyAddedByHypothesisClient: true,
};
}
var appEl = document.querySelector('hypothesis-app'); var appEl = document.querySelector('hypothesis-app');
angular.bootstrap(appEl, ['h'], {strictDi: true}); angular.bootstrap(appEl, ['h'], {strictDi: true});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment