Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
support for %timestamp%
Browse files Browse the repository at this point in the history
  • Loading branch information
54ac committed Oct 6, 2021
1 parent 09c30a6 commit 1e37bab
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion _locales/de/messages.json
Expand Up @@ -63,7 +63,7 @@
"message": "benutzerdefiniertes Kommando"
},
"userCommandTip": {
"message": "Verfügbare Felder:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%"
"message": "Verfügbare Felder:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%\n%timestamp%"
},
"headersPref": {
"message": "Füge Header hinzu"
Expand Down
2 changes: 1 addition & 1 deletion _locales/en/messages.json
Expand Up @@ -69,7 +69,7 @@
"message": "User-defined command"
},
"userCommandTip": {
"message": "Available fields:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%"
"message": "Available fields:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%\n%timestamp%"
},
"headersPref": {
"message": "Include additional headers"
Expand Down
2 changes: 1 addition & 1 deletion _locales/ko/messages.json
Expand Up @@ -69,7 +69,7 @@
"message": "사용자 정의 명령어"
},
"userCommandTip": {
"message": "이용 가능한 옵션:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%"
"message": "이용 가능한 옵션:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%\n%timestamp%"
},
"headersPref": {
"message": "헤더 추가"
Expand Down
2 changes: 1 addition & 1 deletion _locales/pl/messages.json
Expand Up @@ -69,7 +69,7 @@
"message": "Komenda własna"
},
"userCommandTip": {
"message": "Dostępne pola:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%"
"message": "Dostępne pola:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%\n%timestamp%"
},
"headersPref": {
"message": "Dołącz dodatkowe nagłówki"
Expand Down
2 changes: 1 addition & 1 deletion _locales/ru/messages.json
Expand Up @@ -69,7 +69,7 @@
"message": "Пользовательская команда"
},
"userCommandTip": {
"message": "Доступные переменные:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%"
"message": "Доступные переменные:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%\n%timestamp%"
},
"headersPref": {
"message": "Включать дополнительные заголовки"
Expand Down
2 changes: 1 addition & 1 deletion _locales/sk/messages.json
Expand Up @@ -66,7 +66,7 @@
"message": "Používateľom definovaný príkaz"
},
"userCommandTip": {
"message": "Dostupné kľúčové slová:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%"
"message": "Dostupné kľúčové slová:\n%url%\n%filename%\n%useragent%\n%referer%\n%cookie%\n%proxy%\n%origin%\n%tabtitle%\n%timestamp%"
},
"headersPref": {
"message": "Pridať dodatočné hlavičky"
Expand Down
12 changes: 6 additions & 6 deletions background.js
Expand Up @@ -92,9 +92,11 @@ const urlFilter = (requestDetails) => {
blacklistEntries?.filter(
(entry) =>
requestDetails.url?.includes(entry) ||
(requestDetails.documentUrl || requestDetails.originUrl)?.includes(
entry
)
(
requestDetails.documentUrl ||
requestDetails.originUrl ||
requestDetails.initiator
)?.includes(entry)
).length === 0))
) {
queue.push(requestDetails.requestId);
Expand Down Expand Up @@ -314,9 +316,7 @@ chrome.storage.local.get((options) => {
if (urlStorageRestore.length) {
if (cleanupPref)
urlStorageRestore = urlStorageRestore.filter(
(url) =>
new Date().getTime() - (url.timeStamp || url.timestamp) <
604800000
(url) => new Date().getTime() - url.timeStamp < 604800000
);

chrome.storage.local.set({
Expand Down
7 changes: 3 additions & 4 deletions content/popup.js
Expand Up @@ -298,7 +298,7 @@ const copyURL = (info) => {
// sanitize tab title and timestamp
outFilename = outFilename.replace(/[/\\?%*:|"<>]/g, "_");
const outExtension = options.fileExtension || "ts";
const outTimestamp = getTimestamp(e.timeStamp || e.timestamp).replace(
const outTimestamp = getTimestamp(e.timeStamp).replace(
/[/\\?%*:|"<>]/g,
"_"
);
Expand Down Expand Up @@ -347,6 +347,7 @@ const copyURL = (info) => {
case "user":
code = code.replace(new RegExp("%url%", "g"), streamURL);
code = code.replace(new RegExp("%filename%", "g"), filename);
code = code.replace(new RegExp("%timestamp%", "g"), outTimestamp);
break;
default:
break;
Expand Down Expand Up @@ -475,9 +476,7 @@ const createList = () => {
requestDetails.tabData.url;

const timestampCell = document.createElement("td");
timestampCell.textContent = getTimestamp(
requestDetails.timeStamp || requestDetails.timestamp
);
timestampCell.textContent = getTimestamp(requestDetails.timeStamp);

const deleteCell = document.createElement("td");
const deleteX = document.createElement("a");
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Expand Up @@ -3,7 +3,7 @@
"manifest_version": 2,
"name": "The Stream Detector",
"default_locale": "en",
"version": "2.8.1",
"version": "2.8.3",
"permissions": [
"<all_urls>",
"tabs",
Expand Down

0 comments on commit 1e37bab

Please sign in to comment.