2020-08-31 00:49:06 +03:00
|
|
|
export interface Options {
|
|
|
|
useExtension: boolean;
|
|
|
|
supportImmutable: boolean;
|
|
|
|
theme: string;
|
|
|
|
dark: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function getOptions(location: { search: string }) {
|
|
|
|
return {
|
2024-08-05 03:38:28 +03:00
|
|
|
useExtension: location.search.includes('ext'),
|
|
|
|
supportImmutable: location.search.includes('immutable'),
|
2022-05-15 23:16:18 +03:00
|
|
|
theme: getTheme(location),
|
2024-08-05 03:38:28 +03:00
|
|
|
dark: location.search.includes('dark'),
|
2020-08-31 00:49:06 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-05-15 23:16:18 +03:00
|
|
|
function getTheme(location: { search: string }) {
|
2020-08-31 00:49:06 +03:00
|
|
|
const match = /theme=([^&]+)/.exec(location.search);
|
|
|
|
return match ? match[1] : 'inspector';
|
|
|
|
}
|