mirror of
https://github.com/miljegen/browser-milje.git
synced 2025-04-19 07:16:45 +00:00
Compare commits
No commits in common. "main" and "v0.0.1" have entirely different histories.
18
.gitignore
vendored
18
.gitignore
vendored
@ -1,18 +0,0 @@
|
||||
### VisualStudioCode ###
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
!.vscode/*.code-snippets
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# Built Visual Studio Code Extensions
|
||||
*.vsix
|
||||
|
||||
### VisualStudioCode Patch ###
|
||||
# Ignore all local history of files
|
||||
.history
|
||||
.ionide
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"editor.maxTokenizationLineLength": 100000000000000000000
|
||||
}
|
13
Makefile
13
Makefile
@ -1,13 +0,0 @@
|
||||
ENCODED_IMAGES := $(wildcard assets/*.png.64)
|
||||
IMAGES := $(patsubst assets/%.png.64, images/%.png, $(ENCODED_IMAGES))
|
||||
|
||||
out: $(IMAGES)
|
||||
|
||||
images/:
|
||||
mkdir $@
|
||||
echo '*' > images/.gitignore
|
||||
images/%.png: assets/%.png.64 | images/
|
||||
base64 -d $< > $@
|
||||
|
||||
|
||||
|
@ -2,15 +2,11 @@
|
||||
"manifest_version": 3,
|
||||
"name": "browser-milje",
|
||||
"description": "adds a milje table cloth on top of your browser viewport",
|
||||
"version": "0.0.2",
|
||||
"permissions": ["storage", "activeTab", "scripting"],
|
||||
"version": "0.0.1",
|
||||
"action": {
|
||||
"default_popup": "popup.html",
|
||||
"default_icon": "assets/browser-milje.png"
|
||||
},
|
||||
"background": {
|
||||
"service_worker": "background.js"
|
||||
},
|
||||
"icons": {
|
||||
"16": "assets/icon-16.png",
|
||||
"32": "assets/icon-32.png",
|
||||
@ -19,13 +15,8 @@
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["<all_urls>", "file:///"],
|
||||
"js": ["scripts/milje.js", "scripts/contentScript.js"]
|
||||
}
|
||||
],
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": ""
|
||||
}
|
||||
"js": ["scripts/milje.js"],
|
||||
"matches": ["<all_urls>", "file:///"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -25,11 +25,6 @@
|
||||
<body>
|
||||
<h1>browser-milje!</h1>
|
||||
<img id="milje" src="assets/milje.png" alt="this should represent the milje">
|
||||
<input type="file" id="fileInput" accept="image/*">
|
||||
<button id="uploadButton">upload milje!</button>
|
||||
<div id="miljeGallery">
|
||||
|
||||
</div>
|
||||
<script src="milje.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,5 +0,0 @@
|
||||
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
if (message.type === "setMilje") {
|
||||
document.body.style.background = `url(${message.milje})`;
|
||||
}
|
||||
});
|
112
scripts/milje.js
112
scripts/milje.js
File diff suppressed because one or more lines are too long
@ -1,13 +0,0 @@
|
||||
document.getElementById('uploadButton').addEventListener('click', async () => {
|
||||
const miljeInput = document.getElementById('fileInput');
|
||||
const milje = miljeInput.files[0];
|
||||
|
||||
if(!milje) {
|
||||
alert("Please select a milje.");
|
||||
return;
|
||||
}
|
||||
|
||||
const base64Milje = await convertImageToBase64(milje);
|
||||
await saveImage(base64Milje);
|
||||
await displayImage(base64Milje);
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user