Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
console.log("started"); | ||
|
||
chrome.runtime.onMessage.addListener(function(message, sender) { | ||
|
||
alert("ping"); | ||
|
||
newUrl = "http://127.0.0.1:5000?consultation_id="+document.getElementsByClassName('srnummer')[0].textContent; | ||
chrome.tabs.create({ url: newURL }); | ||
|
||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "Kommentator 2000", | ||
"version": "1.0", | ||
"permissions": ["activeTab","scripting","nativeMessaging"], | ||
"action": { | ||
"default_popup": "popup.html" | ||
}, | ||
"background": { | ||
"service_worker": "background.js" | ||
}, | ||
"content_scripts": [ | ||
{ | ||
"matches": ["https://www.fedlex.admin.ch/eli/*"], | ||
"js": ["content.js"], | ||
"css": ["styles.css"] | ||
} | ||
], | ||
"host_permissions": [ | ||
"https://www.fedlex.admin.ch/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Article Selector</title> | ||
<link rel="stylesheet" type="text/css" href="styles.css"> | ||
</head> | ||
<body> | ||
<h1 id="title-h1">Select Articles</h1> | ||
<button id="download-btn">Starte die Vernehmlassung.</button> | ||
<script src="popup.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
console.log("popup.js loaded"); | ||
document.getElementById("title-h1").textContent = "Kommentator 2000"; | ||
document.getElementById("download-btn").addEventListener("click", function(e) { | ||
document.getElementById("title-h1").textContent = "Kommentator 2000, it's a go."; | ||
|
||
|
||
|
||
chrome.runtime.sendMessage({'myPopupIsOpen': true}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
padding: 20px; | ||
} | ||
|
||
#download-btn { | ||
background-color: #4CAF50; | ||
color: white; | ||
padding: 10px 20px; | ||
margin: 10px 0; | ||
border: none; | ||
cursor: pointer; | ||
} | ||
#download-btn:hover { | ||
background-color: #45a049; | ||
} |