parent
e1cdd7cb44
commit
6a5c4c4783
12 changed files with 35 additions and 15 deletions
|
@ -55,10 +55,12 @@ input {
|
|||
input[type=button] {
|
||||
cursor: pointer;
|
||||
min-width: 100px;
|
||||
transition-delay: 0;
|
||||
}
|
||||
input[type=button]:active {
|
||||
input[type=button].active {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
input[type=button]:disabled {
|
||||
opacity: 0.2;
|
||||
cursor: default;
|
||||
|
@ -158,17 +160,19 @@ select {
|
|||
display: none;
|
||||
}
|
||||
|
||||
[data-cmd="refresh"] {
|
||||
margin-left: 2px;
|
||||
[data-cmd] {
|
||||
margin-right: 2px;
|
||||
}
|
||||
[data-cmd="test"] {
|
||||
background-color: #4d72b7;
|
||||
border: solid 1px #4a6dad;
|
||||
color: #fff;
|
||||
}
|
||||
[data-cmd="window"],
|
||||
[data-cmd="apply"] {
|
||||
color: #fff;
|
||||
background-color: #3c923c;
|
||||
border: solid 1px #327932;
|
||||
margin-right: 2px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
[data-cmd="reset"] {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<option value="Firefox">Firefox</option>
|
||||
<option value="Opera">Opera</option>
|
||||
<option value="Edge">Edge</option>
|
||||
<option value="Vivaldi">Vivaldi</option>
|
||||
</optgroup>
|
||||
<optgroup label="Others"></optgroup>
|
||||
</select>
|
||||
|
@ -73,7 +74,8 @@
|
|||
<span flex="1"></span>
|
||||
<input type="button" value="Apply" title="Set this string as the browser's User-Agent string" data-cmd="apply">
|
||||
<input type="button" value="Window" title="Set this string as this window's User-Agent string" data-cmd="window">
|
||||
<input type="button" value="Reset" title="Reset User-Agent string to the default one. This will not reset window-based UA strings. To reset them, use the 'Restart' button" style="margin-left: 2px;" data-cmd="reset">
|
||||
<input type="button" value="Reset" title="Reset User-Agent string to the default one. This will not reset window-based UA strings. To reset them, use the 'Restart' button" data-cmd="reset">
|
||||
<input type="button" value="Test" title="Test your user-agent string" data-cmd="test">
|
||||
</div>
|
||||
<input id="ua" type="text" placeholder="Your preferred user-agent string" title="To set blank user-agent string, use 'empty' keyword">
|
||||
<div id="explore"></div>
|
||||
|
|
|
@ -189,6 +189,18 @@ document.addEventListener('click', ({target}) => {
|
|||
else if (cmd === 'reload') {
|
||||
chrome.runtime.reload();
|
||||
}
|
||||
else if (cmd === 'test') {
|
||||
chrome.storage.local.get({
|
||||
'test': 'https://webbrowsertools.com/useragent/?method=normal&verbose=false'
|
||||
}, prefs => chrome.tabs.create({
|
||||
url: prefs.test
|
||||
}));
|
||||
}
|
||||
|
||||
if (cmd) {
|
||||
target.classList.add('active');
|
||||
window.setTimeout(() => target.classList.remove('active'), 500);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue