Compare commits

...

2 commits

Author SHA1 Message Date
4fdf0f99b1
chore(extension): bump version number for release
All checks were successful
Build extension ZIP / Build extension (push) Successful in 42s
2024-03-12 09:55:33 +00:00
d2811c55df
feat(extension): set user agent on requests 2024-03-12 09:55:15 +00:00
4 changed files with 7 additions and 5 deletions

View file

@ -2,7 +2,7 @@
{
"manifest_version": 2,
"name": "aci",
"version": "0.2.1",
"version": "0.3.0",
"description": "auto checkin",
"content_scripts":[
{

View file

@ -51,6 +51,7 @@ function interceptSubmit(details) {
method: 'POST',
headers: {
'content-type': 'application/json',
'user-agent': 'Mozilla/5.0 (compatible) aci-extension/1.0 (+https://git.ashhhleyyy.dev/ash/aci)',
},
body: JSON.stringify({
code: activity.code,

View file

@ -1,2 +1,3 @@
this.SERVER_URL = 'https://aci-api.ashhhleyyy.dev';
//this.SERVER_URL = 'http://localhost:8000';
this.USER_AGENT = 'Mozilla/5.0 (compatible) aci-extension/1.0 (+https://git.ashhhleyyy.dev/ash/aci)'

View file

@ -113,7 +113,7 @@ chrome.storage.sync.get([
if (window.location.hash.length >= 2) {
const query = window.location.hash.substring(1);
const queryParams = new URLSearchParams(query);
const res = await fetch(SERVER_URL + '/api/codes/query?' + query).catch((e) => {
const res = await fetch(SERVER_URL + '/api/codes/query?' + query, { headers: { 'user-agent': USER_AGENT } }).catch((e) => {
message(`Something went wrong: ${e}`);
console.error(e);
});
@ -125,7 +125,7 @@ chrome.storage.sync.get([
const activity = await res.json();
if (config.enable_reject) {
const rejectRes = await fetch(SERVER_URL + '/3p-proxy/reject?' + query).catch((e) => {
const rejectRes = await fetch(SERVER_URL + '/3p-proxy/reject?' + query, { headers: { 'user-agent': USER_AGENT } }).catch((e) => {
message(`Something went wrong: ${e}`);
console.error(e);
});
@ -138,7 +138,7 @@ chrome.storage.sync.get([
}
if (config.enable_shrine) {
const shrineRes = await fetch(SERVER_URL + '/3p-proxy/shrine-checkout?' + query).catch((e) => {
const shrineRes = await fetch(SERVER_URL + '/3p-proxy/shrine-checkout?' + query, { headers: { 'user-agent': USER_AGENT } }).catch((e) => {
message(`Something went wrong: ${e}`);
console.error(e);
});
@ -162,7 +162,7 @@ chrome.storage.sync.get([
}
}
} else {
const res = await fetch(SERVER_URL + '/api/codes').catch((e) => {
const res = await fetch(SERVER_URL + '/api/codes', { headers: { 'user-agent': USER_AGENT } }).catch((e) => {
message(`Something went wrong: ${e}`);
console.error(e);
});