mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-16 06:18:35 +02:00
remove old example
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
chrome.runtime.onMessage.addListener(borderify);
|
||||
|
||||
function borderify(request, sender, sendResponse) {
|
||||
document.body.style.border = "5px solid " + request.color;
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,17 +0,0 @@
|
||||
{
|
||||
|
||||
"manifest_version": 2,
|
||||
"name": "Borderify",
|
||||
"version": "1.0",
|
||||
|
||||
"permissions": [
|
||||
"activeTab", "tabs"
|
||||
],
|
||||
|
||||
"browser_action": {
|
||||
"default_icon": "images/borders.png",
|
||||
"default_title": "Borderify",
|
||||
"default_popup": "popup/choose_color.html"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
html, body {
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.color-choice {
|
||||
height: 30%;
|
||||
width: 90%;
|
||||
margin: 2% auto;
|
||||
}
|
||||
|
||||
#red {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
#green {
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
#blue {
|
||||
background-color: blue;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="choose_color.css"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="color-choice" id="red"></div>
|
||||
<div class="color-choice" id="green"></div>
|
||||
<div class="color-choice" id="blue"></div>
|
||||
|
||||
<script src="choose_color.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,19 +0,0 @@
|
||||
|
||||
document.addEventListener("click", function(e) {
|
||||
if (! e.target.classList.contains("color-choice")) {
|
||||
return;
|
||||
}
|
||||
|
||||
var chosenColor = e.target.id;
|
||||
|
||||
chrome.tabs.executeScript({
|
||||
file: "content_scripts/borderify.js"
|
||||
}, setColor);
|
||||
|
||||
function setColor() {
|
||||
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
|
||||
chrome.tabs.sendMessage(tabs[0].id, {color: chosenColor});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user