From 4810cdf234699c1ab40c1e5ec001583825669260 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=E2=9D=A4=EF=B8=8F=20=E2=98=AE=EF=B8=8F=20=E2=9C=8B?=
<6723574+louisgv@users.noreply.github.com>
Date: Sun, 16 Apr 2023 22:17:24 -0400
Subject: [PATCH] fix type-only import
---
with-emotion/README.md | 66 +++++++++---------
with-emotion/popup.tsx | 50 +++++++-------
with-firebase-fcm/README.md | 66 +++++++++---------
with-google-analytics/popup.tsx | 1 +
with-jotai/README.md | 66 +++++++++---------
with-jotai/counter.tsx | 18 ++---
with-jotai/popup.tsx | 26 +++----
with-multiple-tailwindcss/README.md | 74 ++++++++++----------
with-propelauth/README.md | 66 +++++++++---------
with-propelauth/background/messages/ping.ts | 26 +++----
with-propelauth/popup.tsx | 76 ++++++++++++---------
with-react-router/README.md | 66 +++++++++---------
with-react-router/popup.tsx | 26 +++----
with-tabs/popup.tsx | 45 +++++++-----
with-tabs/tabs/delta-flyer.tsx | 2 +-
15 files changed, 348 insertions(+), 326 deletions(-)
diff --git a/with-emotion/README.md b/with-emotion/README.md
index 6aa46056..ca9c259f 100644
--- a/with-emotion/README.md
+++ b/with-emotion/README.md
@@ -1,33 +1,33 @@
-This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
-
-## Getting Started
-
-First, run the development server:
-
-```bash
-pnpm dev
-# or
-npm run dev
-```
-
-Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
-
-You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
-
-For further guidance, [visit our Documentation](https://docs.plasmo.com/)
-
-## Making production build
-
-Run the following:
-
-```bash
-pnpm build
-# or
-npm run build
-```
-
-This should create a production bundle for your extension, ready to be zipped and published to the stores.
-
-## Submit to the webstores
-
-The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
+This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
+
+## Getting Started
+
+First, run the development server:
+
+```bash
+pnpm dev
+# or
+npm run dev
+```
+
+Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
+
+You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
+
+For further guidance, [visit our Documentation](https://docs.plasmo.com/)
+
+## Making production build
+
+Run the following:
+
+```bash
+pnpm build
+# or
+npm run build
+```
+
+This should create a production bundle for your extension, ready to be zipped and published to the stores.
+
+## Submit to the webstores
+
+The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
diff --git a/with-emotion/popup.tsx b/with-emotion/popup.tsx
index 7396248b..d428859b 100644
--- a/with-emotion/popup.tsx
+++ b/with-emotion/popup.tsx
@@ -1,25 +1,25 @@
-import { useState } from "react"
-
-import { Container, Link } from "~components"
-
-function IndexPopup() {
- const [data, setData] = useState("")
-
- return (
-
-
+ setData(e.target.value)} value={data} />
+
+ View Docs
+
+
+ )
+}
+
+export default IndexPopup
diff --git a/with-firebase-fcm/README.md b/with-firebase-fcm/README.md
index 6aa46056..ca9c259f 100644
--- a/with-firebase-fcm/README.md
+++ b/with-firebase-fcm/README.md
@@ -1,33 +1,33 @@
-This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
-
-## Getting Started
-
-First, run the development server:
-
-```bash
-pnpm dev
-# or
-npm run dev
-```
-
-Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
-
-You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
-
-For further guidance, [visit our Documentation](https://docs.plasmo.com/)
-
-## Making production build
-
-Run the following:
-
-```bash
-pnpm build
-# or
-npm run build
-```
-
-This should create a production bundle for your extension, ready to be zipped and published to the stores.
-
-## Submit to the webstores
-
-The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
+This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
+
+## Getting Started
+
+First, run the development server:
+
+```bash
+pnpm dev
+# or
+npm run dev
+```
+
+Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
+
+You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
+
+For further guidance, [visit our Documentation](https://docs.plasmo.com/)
+
+## Making production build
+
+Run the following:
+
+```bash
+pnpm build
+# or
+npm run build
+```
+
+This should create a production bundle for your extension, ready to be zipped and published to the stores.
+
+## Submit to the webstores
+
+The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
diff --git a/with-google-analytics/popup.tsx b/with-google-analytics/popup.tsx
index ba2fe952..c8ec195d 100644
--- a/with-google-analytics/popup.tsx
+++ b/with-google-analytics/popup.tsx
@@ -1,4 +1,5 @@
import "https://www.googletagmanager.com/gtag/js?id=$PLASMO_PUBLIC_GTAG_ID"
+
import { useEffect, useState } from "react"
function IndexPopup() {
diff --git a/with-jotai/README.md b/with-jotai/README.md
index 6aa46056..ca9c259f 100644
--- a/with-jotai/README.md
+++ b/with-jotai/README.md
@@ -1,33 +1,33 @@
-This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
-
-## Getting Started
-
-First, run the development server:
-
-```bash
-pnpm dev
-# or
-npm run dev
-```
-
-Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
-
-You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
-
-For further guidance, [visit our Documentation](https://docs.plasmo.com/)
-
-## Making production build
-
-Run the following:
-
-```bash
-pnpm build
-# or
-npm run build
-```
-
-This should create a production bundle for your extension, ready to be zipped and published to the stores.
-
-## Submit to the webstores
-
-The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
+This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
+
+## Getting Started
+
+First, run the development server:
+
+```bash
+pnpm dev
+# or
+npm run dev
+```
+
+Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
+
+You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
+
+For further guidance, [visit our Documentation](https://docs.plasmo.com/)
+
+## Making production build
+
+Run the following:
+
+```bash
+pnpm build
+# or
+npm run build
+```
+
+This should create a production bundle for your extension, ready to be zipped and published to the stores.
+
+## Submit to the webstores
+
+The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
diff --git a/with-jotai/counter.tsx b/with-jotai/counter.tsx
index 039178b2..cbb8a5cc 100644
--- a/with-jotai/counter.tsx
+++ b/with-jotai/counter.tsx
@@ -1,17 +1,17 @@
import { atom, useAtom } from "jotai"
-const counterAtom = atom(0);
+const counterAtom = atom(0)
const CounterView = () => {
- const [counter, setCounter] = useAtom(counterAtom);
+ const [counter, setCounter] = useAtom(counterAtom)
- const onIncrement = (): void => {
- setCounter((value: number): number => value + 1);
- }
+ const onIncrement = (): void => {
+ setCounter((value: number): number => value + 1)
+ }
- const onDecrement = (): void => {
- setCounter((value: number): number => value - 1);
- }
+ const onDecrement = (): void => {
+ setCounter((value: number): number => value - 1)
+ }
return (
Current count: {counter}
@@ -21,4 +21,4 @@ const CounterView = () => {
)
}
-export default CounterView;
+export default CounterView
diff --git a/with-jotai/popup.tsx b/with-jotai/popup.tsx
index ce53cecb..64fa55d5 100644
--- a/with-jotai/popup.tsx
+++ b/with-jotai/popup.tsx
@@ -1,13 +1,13 @@
-import {Provider} from "jotai";
-
-import CounterView from "~counter";
-
-function IndexPopup() {
- return (
-
-
-
- )
-}
-
-export default IndexPopup
+import { Provider } from "jotai"
+
+import CounterView from "~counter"
+
+function IndexPopup() {
+ return (
+
+
+
+ )
+}
+
+export default IndexPopup
diff --git a/with-multiple-tailwindcss/README.md b/with-multiple-tailwindcss/README.md
index eec59a8f..8eb6f302 100644
--- a/with-multiple-tailwindcss/README.md
+++ b/with-multiple-tailwindcss/README.md
@@ -1,37 +1,37 @@
-This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
-
-## Getting Started
-
-First, run the development server:
-
-```bash
-pnpm dev
-# or
-npm run dev
-```
-
-Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
-
-You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
-
-For further guidance, [visit our Documentation](https://docs.plasmo.com/)
-
-## Making production build
-
-Run the following:
-
-```bash
-pnpm build
-# or
-npm run build
-```
-
-This should create a production bundle for your extension, ready to be zipped and published to the stores.
-
-## Submit to the webstores
-
-The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
-
-## Notes
-
-This example makes use of the [postcss-multiple-tailwind](https://github.com/robbevp/postcss-multiple-tailwind) plugin to generate separate styles for content-script and popup.
+This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
+
+## Getting Started
+
+First, run the development server:
+
+```bash
+pnpm dev
+# or
+npm run dev
+```
+
+Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
+
+You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
+
+For further guidance, [visit our Documentation](https://docs.plasmo.com/)
+
+## Making production build
+
+Run the following:
+
+```bash
+pnpm build
+# or
+npm run build
+```
+
+This should create a production bundle for your extension, ready to be zipped and published to the stores.
+
+## Submit to the webstores
+
+The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
+
+## Notes
+
+This example makes use of the [postcss-multiple-tailwind](https://github.com/robbevp/postcss-multiple-tailwind) plugin to generate separate styles for content-script and popup.
diff --git a/with-propelauth/README.md b/with-propelauth/README.md
index 6aa46056..ca9c259f 100644
--- a/with-propelauth/README.md
+++ b/with-propelauth/README.md
@@ -1,33 +1,33 @@
-This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
-
-## Getting Started
-
-First, run the development server:
-
-```bash
-pnpm dev
-# or
-npm run dev
-```
-
-Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
-
-You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
-
-For further guidance, [visit our Documentation](https://docs.plasmo.com/)
-
-## Making production build
-
-Run the following:
-
-```bash
-pnpm build
-# or
-npm run build
-```
-
-This should create a production bundle for your extension, ready to be zipped and published to the stores.
-
-## Submit to the webstores
-
-The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
+This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
+
+## Getting Started
+
+First, run the development server:
+
+```bash
+pnpm dev
+# or
+npm run dev
+```
+
+Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
+
+You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
+
+For further guidance, [visit our Documentation](https://docs.plasmo.com/)
+
+## Making production build
+
+Run the following:
+
+```bash
+pnpm build
+# or
+npm run build
+```
+
+This should create a production bundle for your extension, ready to be zipped and published to the stores.
+
+## Submit to the webstores
+
+The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
diff --git a/with-propelauth/background/messages/ping.ts b/with-propelauth/background/messages/ping.ts
index 9949bdfb..2372bfc4 100644
--- a/with-propelauth/background/messages/ping.ts
+++ b/with-propelauth/background/messages/ping.ts
@@ -1,22 +1,22 @@
-import type {PlasmoMessaging} from "@plasmohq/messaging"
-import {createClient} from "@propelauth/javascript";
+import { createClient } from "@propelauth/javascript"
+
+import type { PlasmoMessaging } from "@plasmohq/messaging"
const client = createClient({
- authUrl: process.env.PLASMO_PUBLIC_AUTH_URL,
- enableBackgroundTokenRefresh: true
+ authUrl: process.env.PLASMO_PUBLIC_AUTH_URL,
+ enableBackgroundTokenRefresh: true
})
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
- const authInfo = await client.getAuthenticationInfoOrNull();
+ const authInfo = await client.getAuthenticationInfoOrNull()
- // If you want to make a fetch to an external API, pass the access token in
- // through the Authorization header, like:
- // Authorization: Bearer ACCESS_TOKEN
- // const message = await querySomeApi(req.body.id, authInfo.accessToken)
+ // If you want to make a fetch to an external API, pass the access token in
+ // through the Authorization header, like:
+ // Authorization: Bearer ACCESS_TOKEN
+ // const message = await querySomeApi(req.body.id, authInfo.accessToken)
- res.send({
- authInfo
- })
+ res.send({
+ authInfo
+ })
}
export default handler
-
diff --git a/with-propelauth/popup.tsx b/with-propelauth/popup.tsx
index 4cc299d7..1bf02bbe 100644
--- a/with-propelauth/popup.tsx
+++ b/with-propelauth/popup.tsx
@@ -1,32 +1,44 @@
-import React from "react"
-import {AuthProvider, useLogoutFunction, withAuthInfo, useHostedPageUrls} from "@propelauth/react";
-
-export default function IndexPopup() {
- return (
-
-
-
- )
-}
-
-const Popup = withAuthInfo(function IndexPopup({isLoggedIn, user}) {
- const logoutFn = useLogoutFunction()
- const {getLoginPageUrl, getSignupPageUrl, getAccountPageUrl} = useHostedPageUrls()
-
- const openAccountPage = () => window.open(getAccountPageUrl())
- const openSignupPage = () => window.open(getSignupPageUrl())
- const openLoginPage = () => window.open(getLoginPageUrl())
-
- if (isLoggedIn) {
- return
+ )
+ }
+})
diff --git a/with-react-router/README.md b/with-react-router/README.md
index 6aa46056..ca9c259f 100644
--- a/with-react-router/README.md
+++ b/with-react-router/README.md
@@ -1,33 +1,33 @@
-This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
-
-## Getting Started
-
-First, run the development server:
-
-```bash
-pnpm dev
-# or
-npm run dev
-```
-
-Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
-
-You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
-
-For further guidance, [visit our Documentation](https://docs.plasmo.com/)
-
-## Making production build
-
-Run the following:
-
-```bash
-pnpm build
-# or
-npm run build
-```
-
-This should create a production bundle for your extension, ready to be zipped and published to the stores.
-
-## Submit to the webstores
-
-The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
+This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
+
+## Getting Started
+
+First, run the development server:
+
+```bash
+pnpm dev
+# or
+npm run dev
+```
+
+Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
+
+You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
+
+For further guidance, [visit our Documentation](https://docs.plasmo.com/)
+
+## Making production build
+
+Run the following:
+
+```bash
+pnpm build
+# or
+npm run build
+```
+
+This should create a production bundle for your extension, ready to be zipped and published to the stores.
+
+## Submit to the webstores
+
+The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
diff --git a/with-react-router/popup.tsx b/with-react-router/popup.tsx
index 0e77f69f..d0b584e0 100644
--- a/with-react-router/popup.tsx
+++ b/with-react-router/popup.tsx
@@ -1,13 +1,13 @@
-import { MemoryRouter } from "react-router-dom"
-
-import { Routing } from "~routes"
-
-function IndexPopup() {
- return (
-
-
-
- )
-}
-
-export default IndexPopup
+import { MemoryRouter } from "react-router-dom"
+
+import { Routing } from "~routes"
+
+function IndexPopup() {
+ return (
+
+
+
+ )
+}
+
+export default IndexPopup
diff --git a/with-tabs/popup.tsx b/with-tabs/popup.tsx
index d95b5d8f..a11f1205 100644
--- a/with-tabs/popup.tsx
+++ b/with-tabs/popup.tsx
@@ -20,25 +20,34 @@ function IndexPopup() {
View Docs
-
-
+ {
+ chrome.tabs.query(
+ { active: true, currentWindow: true },
+ function (tabs) {
+ const { id } = tabs[0]
+ chrome.scripting.executeScript({
+ target: { tabId: id },
+ func: () => {
+ const iframe = document.createElement("iframe")
+ iframe.src = chrome.runtime.getURL("/tabs/delta-flyer.html")
+ iframe.name = "delta-flyer"
+ document.body.appendChild(iframe)
+ }
+ })
+ }
+ )
+ }}>
+ iframe mounting
+