Ze först kommit.

This commit is contained in:
Stian Aune
2019-10-27 10:32:14 +01:00
commit 214cd46de9
11 changed files with 103 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
# Default ignored files
/workspace.xml
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/cyclefraudster.iml" filepath="$PROJECT_DIR$/.idea/cyclefraudster.iml" />
</modules>
</component>
</project>
View File
+20
View File
@@ -0,0 +1,20 @@
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: 'developer.chrome.com'},
})
],
actions: [new chrome.declarativeContent.ShowPageAction()]
}]);
});
let i = 0;
setInterval(() => {
console.log(`${++i}s since start`)
}, 1000);
});
+1
View File
@@ -0,0 +1 @@
alert("Surprise motherfuckers");
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

+23
View File
@@ -0,0 +1,23 @@
{
"name": "YKonsole Helper",
"version": "1.0",
"manifest_version": 2,
"description": "Extension to control YKonsole",
"background": {
"scripts": ["background.js"],
"persistent": false
},
"page_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"icons": {
"32": "icon.png"
},
"permissions": [
"storage",
"activeTab",
"declarativeContent",
"https://indigo.stian-aune.com/"
]
}
+16
View File
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="NO">
<head>
<style>
button {
height: 30px;
width: 30px;
outline: none;
}
</style>
</head>
<body>
<button id="changeColor" value="#FF0000">qqq</button>
<script src="popup.js"></script>
</body>
</html>
+19
View File
@@ -0,0 +1,19 @@
let changeColor = document.getElementById('changeColor');
chrome.storage.sync.get('color', function(data) {
changeColor.style.backgroundColor = data.color;
changeColor.setAttribute('value', data.color);
});
let mOverlay = document.createElement("div");
mOverlay.innerHTML = "<b>QUQ</b>";
changeColor.onclick = function(element) {
// TODO: Add settings to STORAGE
let color = element.target.value;
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.executeScript(
tabs[0].id,
{file: 'contentScript.js'});
});
};