mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
moebius#346: Storage Inspector should trim port from hosts for cookies
Issue #31 https://github.com/MoonchildProductions/moebius/pull/346
This commit is contained in:
parent
b95939dd3c
commit
1c0e05bca2
4 changed files with 40 additions and 4 deletions
|
|
@ -494,7 +494,7 @@ StorageActors.createActor({
|
|||
return host == null;
|
||||
}
|
||||
|
||||
host = trimHttpHttps(host);
|
||||
host = trimHttpHttpsPort(host);
|
||||
|
||||
if (cookie.host.startsWith(".")) {
|
||||
return ("." + host).endsWith(cookie.host);
|
||||
|
|
@ -761,7 +761,7 @@ var cookieHelpers = {
|
|||
host = "";
|
||||
}
|
||||
|
||||
host = trimHttpHttps(host);
|
||||
host = trimHttpHttpsPort(host);
|
||||
|
||||
let cookies = Services.cookies.getCookiesFromHost(host, originAttributes);
|
||||
let store = [];
|
||||
|
|
@ -897,7 +897,7 @@ var cookieHelpers = {
|
|||
opts.path = split[2];
|
||||
}
|
||||
|
||||
host = trimHttpHttps(host);
|
||||
host = trimHttpHttpsPort(host);
|
||||
|
||||
function hostMatches(cookieHost, matchHost) {
|
||||
if (cookieHost == null) {
|
||||
|
|
@ -2452,7 +2452,12 @@ exports.setupParentProcessForIndexedDB = function ({ mm, prefix }) {
|
|||
/**
|
||||
* General helpers
|
||||
*/
|
||||
function trimHttpHttps(url) {
|
||||
function trimHttpHttpsPort(url) {
|
||||
let match = url.match(/(.+):\d+$/);
|
||||
|
||||
if (match) {
|
||||
url = match[1];
|
||||
}
|
||||
if (url.startsWith("http://")) {
|
||||
return url.substr(7);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue