Compare commits

...

4 Commits

Author SHA1 Message Date
Kagami Sascha Rosylight 2896fc6cb4
fix(frontend/MkUrlPreview): allow fullscreen from tweets (#11712)
* fix(frontend/MkUrlPreview): allow fullscreen from tweets

* Update url-preview.test.ts
2023-08-13 12:29:13 +09:00
dependabot[bot] 8b7f54df66
build(deps): bump uesteibar/reviewer-lottery from 2 to 3 (#11500)
Bumps [uesteibar/reviewer-lottery](https://github.com/uesteibar/reviewer-lottery) from 2 to 3.
- [Release notes](https://github.com/uesteibar/reviewer-lottery/releases)
- [Commits](https://github.com/uesteibar/reviewer-lottery/compare/v2...v3)

---
updated-dependencies:
- dependency-name: uesteibar/reviewer-lottery
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-13 12:25:57 +09:00
dependabot[bot] f3bbf8417c
build(deps): bump peter-evans/slash-command-dispatch from 1 to 3 (#11501)
Bumps [peter-evans/slash-command-dispatch](https://github.com/peter-evans/slash-command-dispatch) from 1 to 3.
- [Release notes](https://github.com/peter-evans/slash-command-dispatch/releases)
- [Commits](https://github.com/peter-evans/slash-command-dispatch/compare/v1...v3)

---
updated-dependencies:
- dependency-name: peter-evans/slash-command-dispatch
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-13 12:25:48 +09:00
dependabot[bot] 748d4ebaae
build(deps): bump docker/setup-buildx-action from 2.3.0 to 2.9.1 (#11502)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.3.0 to 2.9.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.3.0...v2.9.1)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-13 12:25:30 +09:00
6 changed files with 22 additions and 6 deletions

View File

@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@v3.5.3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.3.0
uses: docker/setup-buildx-action@v2.9.1
with:
platforms: linux/amd64,linux/arm64
- name: Docker meta

View File

@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v3.5.3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.3.0
uses: docker/setup-buildx-action@v2.9.1
with:
platforms: linux/amd64,linux/arm64
- name: Docker meta

View File

@ -23,7 +23,7 @@ jobs:
private_key: ${{ secrets.DEPLOYBOT_PRIVATE_KEY }}
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v1
uses: peter-evans/slash-command-dispatch@v3
env:
TOKEN: ${{ steps.generate_token.outputs.token }}
with:

View File

@ -8,6 +8,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: uesteibar/reviewer-lottery@v2
- uses: uesteibar/reviewer-lottery@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -28,7 +28,14 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<template v-else-if="tweetId && tweetExpanded">
<div ref="twitter">
<iframe ref="tweet" scrolling="no" frameborder="no" :style="{ position: 'relative', width: '100%', height: `${tweetHeight}px` }" :src="`https://platform.twitter.com/embed/index.html?embedId=${embedId}&amp;hideCard=false&amp;hideThread=false&amp;lang=en&amp;theme=${defaultStore.state.darkMode ? 'dark' : 'light'}&amp;id=${tweetId}`"></iframe>
<iframe
ref="tweet"
allow="fullscreen;web-share"
sandbox="allow-popups allow-scripts allow-same-origin"
scrolling="no"
:style="{ position: 'relative', width: '100%', height: `${tweetHeight}px`, border: 0 }"
:src="`https://platform.twitter.com/embed/index.html?embedId=${embedId}&amp;hideCard=false&amp;hideThread=false&amp;lang=en&amp;theme=${defaultStore.state.darkMode ? 'dark' : 'light'}&amp;id=${tweetId}`"
></iframe>
</div>
<div :class="$style.action">
<MkButton :small="true" inline @click="tweetExpanded = false">

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,13 @@ 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');
});
});