From f03404ad9ecf752e409084988699c5e3ab4e6d10 Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Sun, 6 Aug 2017 15:18:46 +0100 Subject: [PATCH] Removal of legacy CSS for builds after 2015-08-06. Fixes #714 --- index.js | 10 +++++++++- package.json | 2 +- webextension/manifest.json | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 9b14add..0d33891 100644 --- a/index.js +++ b/index.js @@ -592,6 +592,11 @@ ContainerWindow.prototype = { _init(window) { this._window = window; this._tabsElement = this._window.document.getElementById("tabbrowser-tabs"); + const NATIVE_CSS_BUILD_DATE = 20170806; + const NATIVE_CSS_VERSION = 57; + + const buildID = Services.appinfo.appBuildID; + const version = Services.appinfo.version.match(/^[0-9]+\./)[1]; this._style = Style({ uri: self.data.url("usercontext.css") }); this._plusButton = this._window.document.getAnonymousElementByAttribute(this._tabsElement, "anonid", "tabs-newtab-button"); this._overflowPlusButton = this._window.document.getElementById("new-tab-button"); @@ -599,7 +604,10 @@ ContainerWindow.prototype = { // Only hack the normal plus button as the alltabs is done elsewhere this.attachMenuEvent("plus-button", this._plusButton); - attachTo(this._style, this._window); + if (Number(buildID.substring(0, 8)) < NATIVE_CSS_BUILD_DATE + || version < NATIVE_CSS_VERSION) { + attachTo(this._style, this._window); + } }, attachMenuEvent(source, button) { diff --git a/package.json b/package.json index 85177f0..6755f58 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "testpilot-containers", "title": "Containers Experiment", "description": "Containers works by isolating cookie jars using separate origin-attributes defined visually by colored ‘Container Tabs’. This add-on is a modified version of the containers feature for Firefox Test Pilot.", - "version": "3.0.0", + "version": "3.0.1", "author": "Andrea Marchesini, Luke Crouch and Jonathan Kingston", "bugs": { "url": "https://github.com/mozilla/testpilot-containers/issues" diff --git a/webextension/manifest.json b/webextension/manifest.json index bab84d9..52229ac 100644 --- a/webextension/manifest.json +++ b/webextension/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Containers Experiment", - "version": "3.0.0", + "version": "3.0.1", "description": "Containers works by isolating cookie jars using separate origin-attributes defined visually by colored ‘Container Tabs’. This add-on is a modified version of the containers feature for Firefox Test Pilot.", "icons": {