+ },
+
+ getRoot() {
+
+ return window.browser || window.chrome;
+ },
+
+ // Chrome doesn't yet implement the promise based tabs.query :'(
+
+ getActiveTabs() {
+
+ const query = {
+ currentWindow: true,
+ active: true
+ };
+
+ if (internals.promisesSupported) {
+ return internals.getRoot().tabs.query(query);
+ }
+
+ return new Promise((resolve, reject) => {
+
+ internals.getRoot().tabs.query(query, (tabs) => {
+
+ return resolve(tabs);
+ });
+ });
+ },