1
0
Fork 0
mirror of https://github.com/paricafe/misskey.git synced 2025-04-01 09:09:29 -05:00
This commit is contained in:
syuilo 2025-03-20 16:07:52 +09:00
parent f25963e2c2
commit 7f534a41a6
19 changed files with 32 additions and 32 deletions

View file

@ -14,7 +14,7 @@ import { subBoot } from '@/boot/sub-boot.js';
const subBootPaths = ['/share', '/auth', '/miauth', '/oauth', '/signup-complete', '/install-extensions'];
if (subBootPaths.some(i => location.pathname === i || location.pathname.startsWith(i + '/'))) {
if (subBootPaths.some(i => window.location.pathname === i || window.location.pathname.startsWith(i + '/'))) {
subBoot();
} else {
mainBoot();

View file

@ -191,7 +191,7 @@ export async function login(token: AccountWithToken['token'], redirect?: string)
// 他のタブは再読み込みするだけ
reloadChannel.postMessage(null);
// このページはredirectで指定された先に移動
location.href = redirect;
window.location.href = redirect;
return;
}

View file

@ -98,14 +98,14 @@ export async function common(createVue: () => App<Element>) {
document.addEventListener('touchend', () => {}, { passive: true });
// URLに#pswpを含む場合は取り除く
if (location.hash === '#pswp') {
history.replaceState(null, '', location.href.replace('#pswp', ''));
if (window.location.hash === '#pswp') {
history.replaceState(null, '', window.location.href.replace('#pswp', ''));
}
// 一斉リロード
reloadChannel.addEventListener('message', path => {
if (path !== null) location.href = path;
else location.reload();
if (path !== null) window.location.href = path;
else window.location.reload();
});
// If mobile, insert the viewport meta tag
@ -130,11 +130,11 @@ export async function common(createVue: () => App<Element>) {
});
//#region loginId
const params = new URLSearchParams(location.search);
const params = new URLSearchParams(window.location.search);
const loginId = params.get('loginId');
if (loginId) {
const target = getUrlWithoutLoginId(location.href);
const target = getUrlWithoutLoginId(window.location.href);
if (!$i || $i.id !== loginId) {
const account = await getAccountFromId(loginId);

View file

@ -43,7 +43,7 @@ export async function mainBoot() {
if (!$i) uiStyle = 'visitor';
if (searchParams.has('zen')) uiStyle = 'zen';
if (uiStyle === 'deck' && prefer.s['deck.useSimpleUiForNonRootPages'] && location.pathname !== '/') uiStyle = 'zen';
if (uiStyle === 'deck' && prefer.s['deck.useSimpleUiForNonRootPages'] && window.location.pathname !== '/') uiStyle = 'zen';
if (searchParams.has('ui')) uiStyle = searchParams.get('ui');
@ -216,7 +216,7 @@ export async function mainBoot() {
let reloadDialogShowing = false;
stream.on('_disconnected_', async () => {
if (prefer.s.serverDisconnectedBehavior === 'reload') {
location.reload();
window.location.reload();
} else if (prefer.s.serverDisconnectedBehavior === 'dialog') {
if (reloadDialogShowing) return;
reloadDialogShowing = true;
@ -227,7 +227,7 @@ export async function mainBoot() {
});
reloadDialogShowing = false;
if (!canceled) {
location.reload();
window.location.reload();
}
}
});
@ -458,7 +458,7 @@ export async function mainBoot() {
const latestDonationInfoShownAt = miLocalStorage.getItem('latestDonationInfoShownAt');
const neverShowDonationInfo = miLocalStorage.getItem('neverShowDonationInfo');
if (neverShowDonationInfo !== 'true' && (createdAt.getTime() < (Date.now() - (1000 * 60 * 60 * 24 * 3))) && !location.pathname.startsWith('/miauth')) {
if (neverShowDonationInfo !== 'true' && (createdAt.getTime() < (Date.now() - (1000 * 60 * 60 * 24 * 3))) && !window.location.pathname.startsWith('/miauth')) {
if (latestDonationInfoShownAt == null || (new Date(latestDonationInfoShownAt).getTime() < (Date.now() - (1000 * 60 * 60 * 24 * 30)))) {
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkDonation.vue')), {}, {
closed: () => dispose(),

View file

@ -180,7 +180,7 @@ function applyToPreview() {
nextTick(() => {
if (currentPreviewUrl === embedPreviewUrl.value) {
// URL
iframeEl.value?.contentWindow?.location.reload();
iframeEl.value?.contentWindow?.window.location.reload();
}
});
}

View file

@ -87,7 +87,7 @@ function openWindow() {
function nav(ev: MouseEvent) {
if (behavior === 'browser') {
location.href = props.to;
window.location.href = props.to;
return;
}

View file

@ -320,7 +320,7 @@ export class Nirax<DEF extends RouteDef[]> extends EventEmitter<RouterEvents> {
}
const res = this.navigate(fullPath);
if (res.route.path === '/:(*)') {
location.href = fullPath;
window.location.href = fullPath;
} else {
this.emit('push', {
beforeFullPath,

View file

@ -167,7 +167,7 @@ export const navbarItemDef = reactive({
title: i18n.ts.reload,
icon: 'ti ti-refresh',
action: (ev) => {
location.reload();
window.location.reload();
},
},
profile: {

View file

@ -64,7 +64,7 @@ function accepted() {
if (session.value && session.value.app.callbackUrl) {
const url = new URL(session.value.app.callbackUrl);
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:', 'vbscript:'].includes(url.protocol)) throw new Error('invalid url');
location.href = `${session.value.app.callbackUrl}?token=${session.value.token}`;
window.location.href = `${session.value.app.callbackUrl}?token=${session.value.token}`;
}
}

View file

@ -31,7 +31,7 @@ import MkButton from '@/components/MkButton.vue';
const state = ref<'fetching' | 'done'>('fetching');
function fetch() {
const params = new URL(location.href).searchParams;
const params = new URL(window.location.href).searchParams;
// acctdeprecated
let uri = params.get('uri') ?? params.get('acct');
@ -76,12 +76,12 @@ function close(): void {
// 100ms
window.setTimeout(() => {
location.href = '/';
window.location.href = '/';
}, 100);
}
function goToMisskey(): void {
location.href = '/';
window.location.href = '/';
}
fetch();

View file

@ -61,7 +61,7 @@ async function onAccept(token: string) {
const cbUrl = new URL(props.callback);
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:', 'vbscript:'].includes(cbUrl.protocol)) throw new Error('invalid url');
cbUrl.searchParams.set('session', props.session);
location.href = cbUrl.toString();
window.location.href = cbUrl.toString();
} else {
authRoot.value?.showUI('success');
}

View file

@ -182,12 +182,12 @@ function close(): void {
// 100ms
window.setTimeout(() => {
location.href = '/';
window.location.href = '/';
}, 100);
}
function goToMisskey(): void {
location.href = '/';
window.location.href = '/';
}
function onPosted(): void {

View file

@ -17,10 +17,10 @@ export function createRouter(fullPath: string): Router {
return new Nirax(ROUTE_DEF, fullPath, !!$i, page(() => import('@/pages/not-found.vue')));
}
export const mainRouter = createRouter(location.pathname + location.search + location.hash);
export const mainRouter = createRouter(window.location.pathname + window.location.search + window.location.hash);
window.addEventListener('popstate', (event) => {
mainRouter.replace(location.pathname + location.search + location.hash);
mainRouter.replace(window.location.pathname + window.location.search + window.location.hash);
});
mainRouter.addListener('push', ctx => {

View file

@ -34,7 +34,7 @@ function resetDisconnected() {
}
function reload() {
location.reload();
window.location.reload();
}
useStream().on('_disconnected_', onDisconnected);

View file

@ -139,7 +139,7 @@ if (window.innerWidth < 1024) {
const currentUI = miLocalStorage.getItem('ui');
miLocalStorage.setItem('ui_temp', currentUI ?? 'default');
miLocalStorage.setItem('ui', 'default');
location.reload();
window.location.reload();
}
document.documentElement.style.overflowY = 'scroll';

View file

@ -170,7 +170,7 @@ if (window.innerWidth > 1024) {
if (tempUI) {
miLocalStorage.setItem('ui', tempUI);
miLocalStorage.removeItem('ui_temp');
location.reload();
window.location.reload();
}
}

View file

@ -37,7 +37,7 @@ const isRoot = computed(() => mainRouter.currentRoute.value.name === 'index');
const pageMetadata = ref<null | PageMetadata>(null);
const showBottom = !(new URLSearchParams(location.search)).has('zen') && ui === 'deck';
const showBottom = !(new URLSearchParams(window.location.search)).has('zen') && ui === 'deck';
provide(DI.router, mainRouter);
provideMetadataReceiver((metadataGetter) => {

View file

@ -35,6 +35,6 @@ export async function reloadAsk(opts: {
if (opts.unison) {
unisonReload();
} else {
location.reload();
window.location.reload();
}
}

View file

@ -12,9 +12,9 @@ export const reloadChannel = new BroadcastChannel<string | null>('reload');
export function unisonReload(path?: string) {
if (path !== undefined) {
reloadChannel.postMessage(path);
location.href = path;
window.location.href = path;
} else {
reloadChannel.postMessage(null);
location.reload();
window.location.reload();
}
}