Skip to content

Commit

Permalink
Revert "fix: a hydration error in SSR apps (#76)" (#78)
Browse files Browse the repository at this point in the history
This reverts commit c30626f.
  • Loading branch information
koba04 authored Jul 13, 2022
1 parent 69767b9 commit 238244d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 26 deletions.
6 changes: 0 additions & 6 deletions packages/swr-devtools-extensions/manifest-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
"background.js"
]
},
"permissions": [
"scripting",
"tabs",
"http://*/",
"https://*/"
],
"content_scripts": [
{
"matches": [
Expand Down
20 changes: 12 additions & 8 deletions packages/swr-devtools-extensions/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
"background": {
"service_worker": "background.js"
},
"permissions": [
"scripting",
"tabs"
],
"host_permissions": [
"http://*/",
"https://*/"
],
"content_scripts": [
{
"matches": [
Expand All @@ -32,5 +24,17 @@
],
"run_at": "document_start"
}
],
"web_accessible_resources": [
{
"resources": [
"web-accessible.js"
],
"matches": [
"https://*/*",
"http://*/*"

]
}
]
}
8 changes: 8 additions & 0 deletions packages/swr-devtools-extensions/src/content.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { DevToolsMessage } from "swr-devtools";
import { Runtime, runtime } from "webextension-polyfill";

const injectDevToolsHook = () => {
const script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", chrome.runtime.getURL("web-accessible.js"));
document.documentElement.appendChild(script);
};
injectDevToolsHook();

export type ContentMessage =
| {
type: "load";
Expand Down
13 changes: 1 addition & 12 deletions packages/swr-devtools-extensions/src/devtools.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
import { devtools, scripting } from "webextension-polyfill";
import { devtools } from "webextension-polyfill";

devtools.panels.create("SWR", "", "panel.html").then(() => {
console.log("The DevTools panel has been created");
});

scripting
.executeScript({
target: {
tabId: devtools.inspectedWindow.tabId,
allFrames: true,
},
files: ["web-accessible.js"],
})
.then((r) => console.log("executeScript has been success", r))
.catch((e) => console.log("executeScript has been failed", e));

1 comment on commit 238244d

@vercel
Copy link

@vercel vercel bot commented on 238244d Jul 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

swr-devtools – ./

swr-devtools.vercel.app
swr-devtools-koba04.vercel.app
swr-devtools-git-main-koba04.vercel.app

Please sign in to comment.