this._password = doc.getElementById('password');
this._generateButton = doc.getElementById('generate');
- this._options = new SkeletonKeyOptions();
+ // If this is an extension, use defaults until the Chrome settings are loaded.
+ var win = null;
+ if (!this._isChromeExtension())
+ win = window;
+ this._options = new SkeletonKeyOptions(null, win);
+
this._init();
};
*/
SkeletonKey.prototype._initChromeExtension = function() {
return;
- if (typeof chrome == 'undefined' || typeof chrome.extension == 'undefined')
- return;
// getCurrent is undefined for backround pages. Need content script.
chrome.tabs.getCurrent(function (tab) {
console.log(siteKey);
});
};
+
+/**
+ * Checks if SkeletonKey is running as a Chrome extension.
+ * @returns {bool}
+ * @private
+ */
+SkeletonKey.prototype._isChromeExtension = function() {
+ return typeof chrome != 'undefined' && typeof chrome.extension != 'undefined';
+};