Ray Lothian 2017-11-19 13:02:13 +03:30
parent cd6e645458
commit 96b13e4b7f
7 changed files with 57 additions and 21 deletions

View file

@ -1,6 +1,8 @@
Generating the list:
ua-parser.min.js:
https://github.com/faisalman/ua-parser-js/blob/master/dist/ua-parser.min.js
Run
JSON.stringify([...document.querySelectorAll('li a')].map(a => a.textContent))
on
http://www.useragentstring.com/pages/useragentstring.php?typ=Browser
Generating the list:
Run
JSON.stringify([...document.querySelectorAll('li a')].map(a => a.textContent))
on
http://www.useragentstring.com/pages/useragentstring.php?typ=Browser

View file

@ -51,6 +51,7 @@ input {
border: solid 1px #ccc;
box-sizing: border-box;
height: 24px;
border-radius: 0;
}
input[type=button] {
cursor: pointer;

View file

@ -147,12 +147,13 @@
<div hbox>
<input type="search" id="custom" placeholder="Filter items">
<input type="button" value="Update" disabled="true">
<input type="button" value="Refresh" title="Refresh the current page" style="margin-left: 2px;" data-cmd="refresh">
</div>
<div hbox id="agent" pack="center" align="center">
User-Agent String:&nbsp;
<input id="ua" type="text" name="">
<input type="button" value="Apply" data-cmd="apply">
<input type="button" value="Reset" style="margin-left: 2px;" data-cmd="reset">
<input type="button" value="Apply" title="Set this string as the browser's User-Agent string" data-cmd="apply">
<input type="button" value="Reset" title="Reset User-Agent string to the default one" style="margin-left: 2px;" data-cmd="reset">
</div>
<script src="ua-parser.min.js"></script>
<script src="index.js"></script>

View file

@ -160,5 +160,13 @@ document.addEventListener('click', ({target}) => {
ua: ''
});
}
else if (cmd === 'refresh') {
chrome.tabs.query({
active: true,
currentWindow: true
}, ([tab]) => chrome.tabs.reload(tab.id, {
bypassCache: true
}));
}
}
});

File diff suppressed because one or more lines are too long