-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev-it-up.js
30 lines (26 loc) · 1.03 KB
/
dev-it-up.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
'use strict';
// add dev css in disabled state
var linkDev = document.createElement('link');
linkDev.type = 'text/css'
linkDev.href = 'https://git.iddkingsonline.com/designsystem-dev/css/main.css'
linkDev.rel = 'stylesheet';
linkDev.id = 'devcss';
linkDev.disabled = true;
document.head.appendChild(linkDev);
var linkLive = document.querySelector('[href="https://git.iddkingsonline.com/designsystem/css/main.css"]');
// upon status change
chrome.storage.onChanged.addListener(() => {
chrome.storage.sync.get('status', function(data) {
var current = data.status;
current === 'inactive'
// if status is inactive disable dev and activate live css
? ( linkDev.disabled = true,
linkLive.disabled = false)
// if status is active disable live and activate dev css
: ( linkLive.disabled = true,
linkDev.disabled = false);
});
});