Skip to content

Commit 2e51f22

Browse files
committed
[chore] fix compatibility problem
1 parent 34dd24e commit 2e51f22

File tree

7 files changed

+2163
-1430
lines changed

7 files changed

+2163
-1430
lines changed

contents/AutoComplete.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import debounce from 'lodash/debounce'
1010

1111
import { useStorage } from '@plasmohq/storage/hook'
1212

13+
14+
// export const getInlineAnchor: PlasmoGetInlineAnchor = async () => ({
15+
// element: document.querySelector("#pricing"),
16+
// insertPosition: "afterend"
17+
// })
1318
import {
1419
CUSTOM_PROMPT,
1520
HISTORY_KEY,
@@ -22,7 +27,7 @@ import { sleep } from '../utils'
2227
export type AutoCompleteProps = {}
2328

2429
export const config: PlasmoContentScript = {
25-
matches: ['https://chat.openai.com/*']
30+
matches: ['https://chat.openai.com/*', "https://chatgpt.com/*"]
2631
}
2732

2833
export const getStyle = () => {
@@ -33,7 +38,7 @@ export const getStyle = () => {
3338

3439
const getTextArea = async () => {
3540
try {
36-
const textArea = document.querySelector('textarea')
41+
const textArea = document.querySelector('#prompt-textarea ')
3742
if (textArea) {
3843
if (textArea.parentElement.nodeName !== 'DIV') {
3944
throw Error('')
@@ -54,7 +59,11 @@ const getTextArea = async () => {
5459

5560
export const getInlineAnchor: PlasmoGetInlineAnchor = async () => {
5661
const area = await getTextArea()
57-
return area
62+
63+
return {
64+
element: area.parentElement,
65+
insertPosition: "beforebegin",
66+
}
5867
}
5968

6069
const ITEM_PREFIX = `chatgpt-prompt-helper-item-_`

contents/BatchScreenshot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const getStyle = () => {
2727
}
2828

2929
export const config: PlasmoContentScript = {
30-
matches: ['https://chat.openai.com/*']
30+
matches: ['https://chat.openai.com/*', "https://chatgpt.com/*"]
3131
}
3232

3333
const getContainer = async () => {

contents/PromptManagement.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
cursor: pointer;
55
position: absolute;
66
right: -35px;
7-
bottom: 10px;
7+
top: 50%;
8+
transform: translateY(-50%);
89
}
910

1011
.chatgpt-prompt-helper-container {

contents/PromptManagement.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { sleep } from '../utils'
1111
export type AutoCompleteProps = {}
1212

1313
export const config: PlasmoContentScript = {
14-
matches: ['https://chat.openai.com/*']
14+
matches: ['https://chat.openai.com/*', "https://chatgpt.com/*"]
1515
}
1616

1717
export const getStyle = () => {

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "chatgpt-prompt-helper",
33
"displayName": "Chatgpt Prompt Helper",
4-
"version": "1.0.3",
4+
"version": "1.0.4",
55
"description": "Chatgpt prompt, help you ask more efficiently",
66
"author": "cottome",
77
"scripts": {
@@ -20,7 +20,7 @@
2020
"html-to-image": "^1.11.4",
2121
"lodash": "^4.17.21",
2222
"lunr": "^2.3.9",
23-
"plasmo": "0.62.2",
23+
"plasmo": "0.86.2",
2424
"rc-tooltip": "^5.3.1",
2525
"rc-virtual-list": "^3.4.13",
2626
"react": "^18.2.0",
@@ -49,7 +49,8 @@
4949
},
5050
"manifest": {
5151
"host_permissions": [
52-
"https://chat.openai.com/*"
52+
"https://chat.openai.com/*",
53+
"https://chatgpt.com/*"
5354
],
5455
"permissions": [
5556
"storage"

0 commit comments

Comments
 (0)