enhance(frontend): X (formally known as Twitter) (MisskeyIO#208)

* enhance(frontend): TwitterアイコンをXに変更 (misskey-dev#11436)
cheery-picked from 007ed5c929
Co-authored-by: Ebise Lutica <7106976+EbiseLutica@users.noreply.github.com>

* fix(frontend/MkUrlPreview): allow fullscreen from tweets (misskey-dev#11712)
cheery-picked from 2896fc6cb4
Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>

* enhance(frontend): x.comでも展開ができるように (misskey-dev#11757)
cheery-picked from cb80dff7df
Co-authored-by: maguroshouta <54607611+maguroshouta@users.noreply.github.com>
This commit is contained in:
まっちゃとーにゅ
2023-11-06 04:59:48 +09:00
committed by GitHub
parent 6a06711ffd
commit ae9245abdc
4 changed files with 37 additions and 12 deletions

View File

@@ -13,7 +13,7 @@ import MkUrlPreview from '@/components/MkUrlPreview.vue';
type SummalyResult = Awaited<ReturnType<typeof summaly>>;
describe('MkMediaImage', () => {
describe('MkUrlPreview', () => {
const renderPreviewBy = async (summary: Partial<SummalyResult>): Promise<RenderResult> => {
if (!summary.player) {
summary.player = {
@@ -143,4 +143,22 @@ describe('MkMediaImage', () => {
assert.exists(iframe, 'iframe should exist');
assert.strictEqual(iframe?.parentElement?.style.paddingTop, '200px');
});
test('Loading a tweet in iframe', async () => {
const iframe = await renderAndOpenPreview({
url: 'https://twitter.com/i/web/status/1685072521782325249',
});
assert.exists(iframe, 'iframe should exist');
assert.strictEqual(iframe?.getAttribute('allow'), 'fullscreen;web-share');
assert.strictEqual(iframe?.getAttribute('sandbox'), 'allow-popups allow-scripts allow-same-origin');
});
test('Loading a post in iframe', async () => {
const iframe = await renderAndOpenPreview({
url: 'https://x.com/i/web/status/1685072521782325249',
});
assert.exists(iframe, 'iframe should exist');
assert.strictEqual(iframe?.getAttribute('allow'), 'fullscreen;web-share');
assert.strictEqual(iframe?.getAttribute('sandbox'), 'allow-popups allow-scripts allow-same-origin');
});
});