Move getMemory where it belongs
This commit is contained in:
parent
2bd4e8b9da
commit
729a60a998
@ -69,3 +69,7 @@ export function init() {
|
||||
|
||||
(window as any).memory = memory;
|
||||
}
|
||||
|
||||
export function getMemory(): Memory {
|
||||
return (browser.extension.getBackgroundPage().window as any).memory as Memory;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { getMemory } from "../util";
|
||||
import { getMemory } from "../memory";
|
||||
|
||||
function Report() {
|
||||
const origin = new URL(document.location.toString()).searchParams.get(
|
||||
|
@ -2,7 +2,8 @@ import React, { useEffect, useState } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import Options from "../options";
|
||||
import { StolenData } from "./stolen-data";
|
||||
import { getMemory, useEmitter } from "../util";
|
||||
import { useEmitter } from "../util";
|
||||
import { getMemory } from "../memory";
|
||||
|
||||
async function getCurrentTab() {
|
||||
const [tab] = await browser.tabs.query({
|
||||
|
@ -1,7 +1,8 @@
|
||||
import React from "react";
|
||||
import { getMemory } from "../memory";
|
||||
import { MergedStolenDataEntry, Sources } from "../stolen-data-entry";
|
||||
|
||||
import { MergedStolenDataEntry, Sources } from "../request-cluster";
|
||||
import { getMemory, hyphenate } from "../util";
|
||||
import { hyphenate } from "../util";
|
||||
|
||||
function StolenDataValueTable({
|
||||
entry,
|
||||
|
@ -1,7 +1,9 @@
|
||||
import React from "react";
|
||||
import { RequestCluster } from "../request-cluster";
|
||||
|
||||
import StolenDataCluster from "./stolen-data-cluster";
|
||||
import { getMemory, getshorthost } from "../util";
|
||||
import { getshorthost } from "../util";
|
||||
import { getMemory } from "../memory";
|
||||
|
||||
export function StolenData({
|
||||
origin,
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { TCModel } from "@iabtcf/core";
|
||||
import ExtendedRequest from "./extended-request";
|
||||
import { getMemory, isJSONObject, isURL, parseToObject } from "./util";
|
||||
import { getMemory } from "./memory";
|
||||
import { isJSONObject, isURL, parseToObject } from "./util";
|
||||
|
||||
export type Sources = "cookie" | "pathname" | "queryparams" | "header";
|
||||
|
||||
|
4
util.ts
4
util.ts
@ -83,10 +83,6 @@ export function hyphenate(str: string): string {
|
||||
return str.replace(/[_\[A-Z]/g, `${String.fromCharCode(173)}$&`);
|
||||
}
|
||||
|
||||
export function getMemory(): Memory {
|
||||
return (browser.extension.getBackgroundPage().window as any).memory as Memory;
|
||||
}
|
||||
|
||||
export function unique(array: string[]) {
|
||||
return Array.from(new Set(array));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user