-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from giantpinkrobots/next
Merging next into main for v2024.2.29
- Loading branch information
Showing
28 changed files
with
1,534 additions
and
956 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,26 @@ | ||
chrome.downloads.onCreated.addListener(function(downloadItem) { | ||
chrome.storage.sync.get('enabled', function(data) { | ||
if (data.enabled) { | ||
sendToAria2(downloadItem); | ||
} | ||
}); | ||
}); | ||
|
||
function sendToAria2(downloadItem) { | ||
fetch('http://localhost:6801/jsonrpc', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
body: JSON.stringify({ | ||
jsonrpc: '2.0', | ||
id: '1', | ||
method: 'aria2.addUri', | ||
params: [[downloadItem.url]] | ||
}) | ||
}).then(response => { | ||
chrome.downloads.cancel(downloadItem.id); | ||
}).catch(error => { | ||
|
||
}); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,20 @@ | ||
{ | ||
"name": "Varia Integrator", | ||
"description": "Route all downloads to Varia if it's running.", | ||
"version": "1.0", | ||
"icons": { | ||
"16": "icon16.png", | ||
"48": "icon48.png", | ||
"128": "icon128.png" | ||
}, | ||
"action": { | ||
"default_popup": "popup.html" | ||
}, | ||
"permissions": ["downloads", "storage"], | ||
"host_permissions": ["http://localhost:6801/jsonrpc"], | ||
"manifest_version": 3, | ||
"background": { | ||
"service_worker": "background.js" | ||
} | ||
} | ||
|
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,23 @@ | ||
{ | ||
"name": "Varia Integrator", | ||
"description": "Route all downloads to Varia if it's running.", | ||
"version": "1.0", | ||
"icons": { | ||
"16": "icon16.png", | ||
"48": "icon48.png", | ||
"128": "icon128.png" | ||
}, | ||
"browser_action": { | ||
"default_popup": "popup.html" | ||
}, | ||
"permissions": ["downloads", "storage", "<all_urls>"], | ||
"manifest_version": 2, | ||
"background": { | ||
"scripts": ["background.js"] | ||
}, | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
} | ||
} | ||
} |
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,86 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
body { | ||
width: 200px; | ||
height: 125px; | ||
background-color: #f6f5f4; | ||
border-radius: 8px; | ||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); | ||
} | ||
.with-drop-shadow { | ||
filter: drop-shadow(rgb(122, 122, 122) 0rem 0rem 5px); | ||
} | ||
.switch { | ||
position: relative; | ||
display: inline-block; | ||
width: 60px; | ||
height: 34px; | ||
} | ||
.switch input { | ||
opacity: 0; | ||
width: 0; | ||
height: 0; | ||
} | ||
.slider { | ||
position: absolute; | ||
cursor: pointer; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-color: #ccc; | ||
transition: .15s; | ||
border-radius: 34px; | ||
} | ||
.slider:before { | ||
position: absolute; | ||
content: ""; | ||
height: 26px; | ||
width: 26px; | ||
left: 4px; | ||
bottom: 4px; | ||
background-color: white; | ||
transition: .15s; | ||
border-radius: 50%; | ||
} | ||
input:checked + .slider { | ||
background-color: #2196F3; | ||
} | ||
input:checked + .slider:before { | ||
transform: translateX(26px); | ||
} | ||
@media (prefers-color-scheme: dark) { | ||
body { | ||
background-color: #242424; | ||
} | ||
.with-drop-shadow { | ||
filter: drop-shadow(rgb(39, 39, 39) 0rem 0rem 5px); | ||
} | ||
.feather-icons { | ||
filter: invert(100%); | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<center> | ||
<br> | ||
<div style="display: flex; justify-content: center; align-items: center;"> | ||
<img class="feather-icons with-drop-shadow"; src="download.png"> | ||
| ||
<img class="feather-icons"; src="arrow-right.png"> | ||
| ||
<img class="with-drop-shadow"; src="icon48.png"> | ||
</div> | ||
<br> | ||
<label class="switch"> | ||
<input type="checkbox" id="toggleSwitch"> | ||
<span class="slider"></span> | ||
</label> | ||
<br> | ||
</center> | ||
<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,10 @@ | ||
document.addEventListener('DOMContentLoaded', function () { | ||
var toggleSwitch = document.getElementById('toggleSwitch'); | ||
chrome.storage.sync.get('enabled', function(data) { | ||
toggleSwitch.checked = data.enabled; | ||
}); | ||
toggleSwitch.addEventListener('change', function () { | ||
var enabled = this.checked; | ||
chrome.storage.sync.set({enabled: enabled}); | ||
}); | ||
}); |
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
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
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
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
Oops, something went wrong.