-
Notifications
You must be signed in to change notification settings - Fork 6
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
1 parent
8cf46ff
commit 32b7764
Showing
13 changed files
with
116 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
// dark mode icon handler | ||
chrome.runtime.onMessage.addListener( (e) => { | ||
if (e.scheme == 'dark') { | ||
chrome.browserAction.setIcon({ path: '/icon-dark_38x38.png' }); | ||
} | ||
}); | ||
|
||
// open run.html (used to execute command via terminalPrivate API) at login | ||
chrome.runtime.onStartup.addListener( () => { | ||
chrome.windows.create({url: "/run.html", type: 'popup', state: 'minimized'}) | ||
chrome.windows.create({url: "run.html", type: 'popup', state: 'minimized', height: 200, width: 200}) | ||
}); | ||
|
||
// prompt user to enter a command after install | ||
chrome.runtime.onInstalled.addListener( (i) => { | ||
if (i.reason == 'install') { | ||
chrome.windows.create({url: '/option.html', type: 'popup', height: 221, width: 230}) | ||
}}) | ||
chrome.windows.create({url: 'option.html', type: 'popup', height: 300, width: 310}) | ||
} | ||
}); |
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,5 @@ | ||
// a content script for setting dark mode icon | ||
// see https://stackoverflow.com/questions/58880234/toggle-chrome-extension-icon-based-on-light-or-dark-mode-browser | ||
if ( window.matchMedia('(prefers-color-scheme: dark)').matches ) { | ||
chrome.runtime.sendMessage({ scheme: 'dark' }) | ||
} |
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.
File renamed without changes
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
<!-- run.html: wrapper for run.js --> | ||
|
||
<html> | ||
<script src='/run.js'></script> | ||
<head> | ||
<link rel="stylesheet" href="style.css"> | ||
<script src='/run.js'></script> | ||
</head> | ||
<body> | ||
</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
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,53 @@ | ||
body { | ||
height: 300px; | ||
width: 300px; | ||
} | ||
|
||
button, input, body { | ||
font-family: Arial; | ||
font-size: 15px; | ||
margin-bottom: 3px; | ||
margin-right: 2px; | ||
} | ||
|
||
button { | ||
background-color: #1a73e8; | ||
color: white; | ||
border-radius: 4px; | ||
padding: 5px 10px; | ||
border: none; | ||
cursor: pointer; | ||
} | ||
|
||
button:hover { | ||
opacity: 0.9; | ||
} | ||
|
||
input[type="text"] { | ||
height: 25px; | ||
border: 2px solid; | ||
border-radius: 4px; | ||
} | ||
|
||
@media (prefers-color-scheme: light) { | ||
body, input[type="text"], textarea { | ||
background-color: #fff; | ||
color: #000 | ||
} | ||
input[type="text"], textarea { | ||
border-color: rgb(0, 0, 0); | ||
} | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
body, input[type="text"], textarea { | ||
background-color: #1e1e1e; | ||
color: rgb(199, 199, 199); | ||
} | ||
input[type="text"], textarea { | ||
border-color: rgb(199, 199, 199); | ||
} | ||
::placeholder { | ||
color: rgb(183, 183, 183); | ||
} | ||
} |