5 changed files with 88 additions and 0 deletions
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
// Copyright 2018 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'; |
||||
|
||||
chrome.runtime.onInstalled.addListener(function () { |
||||
chrome.storage.sync.set({color: '#3aa757'}, function () { |
||||
console.log('The color is green.'); |
||||
}); |
||||
chrome.declarativeContent.onPageChanged.removeRules(undefined, function () { |
||||
chrome.declarativeContent.onPageChanged.addRules([{ |
||||
conditions: [new chrome.declarativeContent.PageStateMatcher({ |
||||
pageUrl: {hostEquals: 'luna-development.net'}, |
||||
})], |
||||
actions: [new chrome.declarativeContent.ShowPageAction()] |
||||
}]); |
||||
}); |
||||
}); |
After Width: | Height: | Size: 27 KiB |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
{ |
||||
"name": "Kara CX", |
||||
"version": "1.0", |
||||
"description": "Your personal chatbot.", |
||||
"permissions": ["declarativeContent", "storage"], |
||||
"background": { |
||||
"scripts": ["background.js"], |
||||
"persistent": false |
||||
}, |
||||
"page_action": { |
||||
"default_popup": "popup.html", |
||||
"default_icon": { |
||||
"16": "images/luna.png", |
||||
"32": "images/luna.png", |
||||
"48": "images/luna.png", |
||||
"128": "images/luna.png" |
||||
} |
||||
}, |
||||
"icons": { |
||||
"16": "images/luna.png", |
||||
"32": "images/luna.png", |
||||
"48": "images/luna.png", |
||||
"128": "images/luna.png" |
||||
}, |
||||
"manifest_version": 2 |
||||
} |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<title>Kara CX</title> |
||||
<style> |
||||
body { |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
#frame { |
||||
border: none; |
||||
margin: 0; |
||||
height: 500px; |
||||
width: 400px; |
||||
} |
||||
</style> |
||||
</head> |
||||
<body> |
||||
<iframe src="https://luna-development.net/kara" id="frame"></iframe> |
||||
</body> |
||||
</html> |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
// Copyright 2018 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'; |
||||
|
||||
// let changeColor = document.getElementById('changeColor');
|
||||
//
|
||||
// chrome.storage.sync.get('color', function(data) {
|
||||
// changeColor.style.backgroundColor = data.color;
|
||||
// changeColor.setAttribute('value', data.color);
|
||||
// });
|
||||
//
|
||||
// changeColor.onclick = function(element) {
|
||||
// let color = element.target.value;
|
||||
// chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
|
||||
// chrome.tabs.executeScript(
|
||||
// tabs[0].id,
|
||||
// {code: 'document.body.style.backgroundColor = "' + color + '";'});
|
||||
// });
|
||||
// };
|
Reference in new issue