From d0bae9abe1dd47d994ba60a1dea472e122fb5e14 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Mon, 29 May 2023 17:18:43 -0400 Subject: [PATCH] This is a maintenance commit, while working towards building a version of the extension that can be packaged to not use the CDN. --- src/entry_ext.js | 1 + .../main_menu/components/home-page.vue | 37 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/entry_ext.js b/src/entry_ext.js index 6a9d9f57..7c657a94 100644 --- a/src/entry_ext.js +++ b/src/entry_ext.js @@ -21,5 +21,6 @@ script.async = true; script.crossOrigin = 'anonymous'; script.src = `${SERVER}/${FLAVOR}.js?_=${Date.now()}`; + document.body.classList.add('ffz-ext'); document.head.appendChild(script); })(); diff --git a/src/modules/main_menu/components/home-page.vue b/src/modules/main_menu/components/home-page.vue index c167a786..3f2f6d1d 100644 --- a/src/modules/main_menu/components/home-page.vue +++ b/src/modules/main_menu/components/home-page.vue @@ -189,14 +189,16 @@ - - {{ t('home.tweets', 'Tweets by FrankerFaceZ') }} - + @@ -207,6 +209,7 @@ import HOME_MD from '../home.md'; import {createElement as e} from 'utilities/dom'; +import { EXTENSION } from 'utilities/constants'; export default { props: ['item', 'context'], @@ -217,7 +220,8 @@ export default { theme: '', addons: null, new_addons: null, - unseen: this.item.getUnseen() + unseen: this.item.getUnseen(), + not_extension: ! EXTENSION } }, @@ -241,13 +245,14 @@ export default { mounted() { let el; - document.head.appendChild(el = e('script', { - id: 'ffz--twitter-widget-script', - async: true, - charset: 'utf-8', - src: 'https://platform.twitter.com/widgets.js', - onLoad: () => el.remove() - })); + if ( this.not_extension ) + document.head.appendChild(el = e('script', { + id: 'ffz--twitter-widget-script', + async: true, + charset: 'utf-8', + src: 'https://platform.twitter.com/widgets.js', + onLoad: () => el.remove() + })); }, methods: {