Skip to content

Commit

Permalink
Removed console logging in content script. Fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
tdulcet committed Feb 17, 2024
1 parent d5393ab commit 2b82372
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion common.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export function getmessage(securityInfo) {
* @returns {string}
*/
export function countryCode(country) {
return Array.from(country.toUpperCase(), (c) => String.fromCodePoint(c.codePointAt() + 127397)).join("");
return Array.from(country.toUpperCase(), (c) => String.fromCodePoint(c.codePointAt() + 0x1F1A5)).join("");
}

/**
Expand Down
4 changes: 2 additions & 2 deletions content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ new PerformanceObserver((list, observer) => {
const entries = list.getEntries();
// console.log(entries);
const entry = entries.find((x) => x.name === "first-contentful-paint");

Check failure on line 32 in content_script.js

View workflow job for this annotation

GitHub Actions / ESLint

'entry' is assigned a value but never used

Check failure on line 32 in content_script.js

View workflow job for this annotation

GitHub Actions / ESLint

'entry' is assigned a value but never used

Check failure on line 32 in content_script.js

View workflow job for this annotation

GitHub Actions / ESLint

'entry' is assigned a value but never used
console.log(`First Contentful Paint: ${entry ? `${entry.startTime} ms` : "None"}`, entry);
// console.log(`First Contentful Paint: ${entry ? `${entry.startTime} ms` : "None"}`, entry);

paint = entries;
send();
Expand All @@ -40,7 +40,7 @@ new PerformanceObserver((list, observer) => {
const entries = list.getEntries();
// console.log(entries);
const entry = entries.at(-1);
console.log(`Largest Contentful Paint: ${entry.startTime} ms`, entry);
// console.log(`Largest Contentful Paint: ${entry.startTime} ms`, entry);

lcp = entries;
send();
Expand Down
8 changes: 4 additions & 4 deletions options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ <h1>Toolbar</h1>
<label for="icon8"><strong>Largest Contentful Paint time</strong></label>
<ul class="list">
<li>Icon and badge: Largest Contentful Paint (LCP) time in milliseconds (requires
Firefox 121 or greater)<br>(e.g. <span class="large">🟩</span> and <code>2500</code>
Firefox 122 or greater)<br>(e.g. <span class="large">🟩</span> and <code>2500</code>
respectively or <span class="large">🟨</span> and <code>4000</code>)</li>
</ul>
</div>
Expand Down Expand Up @@ -195,7 +195,7 @@ <h1>Location</h1>
<span class="line indent helper-text">Note that the databases do not have the location for all
IP addresses, so select the one with the most accuracy for your locations of interest. Users
with a very slow internet connection or limited memory (RAM) may want to select one of the
much smaller “Country” databases.</span>
much smaller “Country only” databases.</span>

<fieldset>
<legend>None:</legend>
Expand Down Expand Up @@ -257,7 +257,7 @@ <h1>Location</h1>
<input id="GeoDB4" type="radio" name="GeoDB" value="4">
<label for="GeoDB4"><strong>IP2Location LITE</strong></label>
<ul class="list">
<li>Updated Monthly</li>
<li>Updated Bimonthly</li>
</ul>
<span class="line indent helper-text">This site or product includes IP2Location LITE
data available from <a href="https://lite.ip2location.com"
Expand Down Expand Up @@ -300,7 +300,7 @@ <h1>Location</h1>
<input id="GeoDB7" type="radio" name="GeoDB" value="7">
<label for="GeoDB7"><strong>IP2Location LITE</strong></label>
<ul class="list">
<li>Updated Monthly</li>
<li>Updated Bimonthly</li>
</ul>
<span class="line indent helper-text">This site or product includes IP2Location LITE
data available from <a href="https://lite.ip2location.com"
Expand Down
3 changes: 3 additions & 0 deletions worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,21 @@ function agetGeoIP(url, v, cache, retry = 0) {
let length = response.headers.get("Content-Length");
length &&= Number.parseInt(length, 10);
console.log(Array.from(response.headers.entries()), modified, text.length, length);

Check warning on line 88 in worker.js

View workflow job for this annotation

GitHub Actions / ESLint

Trailing spaces not allowed

Check warning on line 88 in worker.js

View workflow job for this annotation

GitHub Actions / ESLint

Trailing spaces not allowed

Check warning on line 88 in worker.js

View workflow job for this annotation

GitHub Actions / ESLint

Trailing spaces not allowed
return [GEOIP, modified, length];
}

console.error(response);
console.timeEnd(alabel);

Check warning on line 94 in worker.js

View workflow job for this annotation

GitHub Actions / ESLint

Trailing spaces not allowed

Check warning on line 94 in worker.js

View workflow job for this annotation

GitHub Actions / ESLint

Trailing spaces not allowed

Check warning on line 94 in worker.js

View workflow job for this annotation

GitHub Actions / ESLint

Trailing spaces not allowed
return Promise.reject();
}).catch(async (error) => {
if (retry >= 2) {
throw error;
}
console.error(error);
await delay((1 << retry) * 1000);

Check warning on line 102 in worker.js

View workflow job for this annotation

GitHub Actions / ESLint

Trailing spaces not allowed

Check warning on line 102 in worker.js

View workflow job for this annotation

GitHub Actions / ESLint

Trailing spaces not allowed

Check warning on line 102 in worker.js

View workflow job for this annotation

GitHub Actions / ESLint

Trailing spaces not allowed
return agetGeoIP(url, v, cache, retry + 1);
});
}
Expand Down

0 comments on commit 2b82372

Please sign in to comment.