Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "URL der Seite, auf der die Aktion beginnt."
},
"Option_recordUrl": {
"message": "Recorder-URL"
},
"Option_recordUrl_desc": {
"message": "URL, zu der beim Öffnen des Recorders navigiert wird. Wird nur beim Bearbeiten verwendet."
},
"Option_pageAction_title": {
"message": "Aktionen"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@
"Option_startUrl_desc": {
"message": "URL of the page where the action starts."
},
"Option_recordUrl": {
"message": "Recorder URL"
},
"Option_recordUrl_desc": {
"message": "URL to navigate when opening the recorder. Used only during editing."
},
"Option_pageAction_title": {
"message": "Actions"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "URL de la página donde comienza la acción."
},
"Option_recordUrl": {
"message": "URL del Grabador"
},
"Option_recordUrl_desc": {
"message": "URL a la que navegar al abrir el grabador. Se usa solo durante la edición."
},
"Option_pageAction_title": {
"message": "Acciones"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "URL de la page où l'action commence."
},
"Option_recordUrl": {
"message": "URL de l'enregistreur"
},
"Option_recordUrl_desc": {
"message": "URL vers laquelle naviguer lors de l'ouverture de l'enregistreur. Utilisée uniquement lors de l'édition."
},
"Option_pageAction_title": {
"message": "Actions"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/hi/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "पेज का URL जहां एक्शन शुरू होता है।"
},
"Option_recordUrl": {
"message": "रिकॉर्डर URL"
},
"Option_recordUrl_desc": {
"message": "रिकॉर्डर खोलते समय नेविगेट करने का URL। केवल संपादन के दौरान उपयोग किया जाता है।"
},
"Option_pageAction_title": {
"message": "एक्शन"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/id/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "URL halaman di mana tindakan dimulai."
},
"Option_recordUrl": {
"message": "URL Perekam"
},
"Option_recordUrl_desc": {
"message": "URL untuk dinavigasi saat membuka perekam. Hanya digunakan saat pengeditan."
},
"Option_pageAction_title": {
"message": "Tindakan"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/it/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "URL della pagina dove inizia l'azione."
},
"Option_recordUrl": {
"message": "URL del registratore"
},
"Option_recordUrl_desc": {
"message": "URL a cui navigare all'apertura del registratore. Utilizzato solo durante la modifica."
},
"Option_pageAction_title": {
"message": "Azione"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,12 @@
"Option_startUrl_desc": {
"message": "アクションを開始するページのURL"
},
"Option_recordUrl": {
"message": "レコーダー用URL"
},
"Option_recordUrl_desc": {
"message": "レコーダーを起動するときに遷移するURL。編集時のみ使用します。"
},
"Option_pageAction_title": {
"message": "Actions"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/ko/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "작업이 시작되는 페이지의 URL."
},
"Option_recordUrl": {
"message": "레코더 URL"
},
"Option_recordUrl_desc": {
"message": "레코더를 열 때 이동할 URL. 편집 중에만 사용됩니다."
},
"Option_pageAction_title": {
"message": "작업"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/ms/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "URL halaman di mana tindakan bermula."
},
"Option_recordUrl": {
"message": "URL Perakam"
},
"Option_recordUrl_desc": {
"message": "URL untuk dinavigasi semasa membuka perakam. Digunakan hanya semasa penyuntingan."
},
"Option_pageAction_title": {
"message": "Tindakan"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/pt_BR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "URL da página onde a ação começa."
},
"Option_recordUrl": {
"message": "URL do Gravador"
},
"Option_recordUrl_desc": {
"message": "URL para navegar ao abrir o gravador. Usado apenas durante a edição."
},
"Option_pageAction_title": {
"message": "Ações"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/pt_PT/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "URL da página onde a ação começa."
},
"Option_recordUrl": {
"message": "URL do Gravador"
},
"Option_recordUrl_desc": {
"message": "URL para navegar ao abrir o gravador. Usado apenas durante a edição."
},
"Option_pageAction_title": {
"message": "Ações"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "URL страницы, где начинается действие."
},
"Option_recordUrl": {
"message": "URL рекордера"
},
"Option_recordUrl_desc": {
"message": "URL для перехода при открытии рекордера. Используется только при редактировании."
},
"Option_pageAction_title": {
"message": "Действие"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/extension/public/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
"Option_startUrl_desc": {
"message": "操作开始的页面URL。"
},
"Option_recordUrl": {
"message": "录制器URL"
},
"Option_recordUrl_desc": {
"message": "打开录制器时导航到的URL。仅在编辑时使用。"
},
"Option_pageAction_title": {
"message": "操作"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ const CommandEditDialogInner = ({
defaultValue: "",
})

const recordUrl = useWatch({
control: form.control,
name: "pageActionOption.recordUrl",
defaultValue: "",
})

const iconUrl = useWatch({
control: form.control,
name: "iconUrl",
Expand All @@ -291,17 +297,19 @@ const CommandEditDialogInner = ({
const iconUrlSrc = searchUrl || startUrl

const openPageActionRecorder = async () => {
const recUrl = recordUrl || startUrl
await Storage.set<PageActionRecordingData>(
SESSION_STORAGE_KEY.PA_RECORDING,
{
startUrl,
recordUrl,
openMode: getValues("pageActionOption.openMode"),
size: getValues("popupOption") ?? POPUP_OPTION,
steps: getValues("pageActionOption.steps"),
},
)
await Ipc.send(BgCommand.startPageActionRecorder, {
startUrl,
startUrl: recUrl,
openMode: getValues("pageActionOption.openMode"),
size: getValues("popupOption") ?? POPUP_OPTION,
screen: await getScreenSize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export const PageActionSection = ({
keyName: "_id",
})
const steps = pageActionArray.fields as unknown as PageActionStep[]
const recDisabled = !getValues("pageActionOption.startUrl")
const recDisabled = !(
getValues("pageActionOption.recordUrl") ||
getValues("pageActionOption.startUrl")
)

// for Editor
const [editId, setEditId] = useState<string | null>(null)
Expand Down Expand Up @@ -99,6 +102,17 @@ export const PageActionSection = ({
previewUrl={getValues("iconUrl")}
/>

<InputField
control={form.control}
name="pageActionOption.recordUrl"
formLabel={t("recordUrl")}
inputProps={{
type: "string",
...register("pageActionOption.recordUrl", {}),
}}
description={t("recordUrl_desc")}
/>

<OpenModeToggleField
control={form.control}
name="pageActionOption.openMode"
Expand Down
5 changes: 3 additions & 2 deletions packages/extension/src/services/pageAction/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,10 @@ export const reset = (_: any, sender: Sender): boolean => {
const option = await Storage.get<PageActionRecordingData>(
SESSION_STORAGE_KEY.PA_RECORDING,
)
if (tabId && option.startUrl) {
const reloadUrl = option.recordUrl || option.startUrl
if (tabId && reloadUrl) {
try {
await chrome.tabs.update(tabId, { url: option.startUrl })
await chrome.tabs.update(tabId, { url: reloadUrl })
} catch (e) {
console.error("Failed to reload the tab:", e)
}
Expand Down
1 change: 1 addition & 0 deletions packages/extension/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export type PageActionStep = {

export type PageActionOption = {
startUrl: string
recordUrl?: string
openMode: PAGE_ACTION_OPEN_MODE
steps: Array<PageActionStep>
userVariables?: Array<UserVariable>
Expand Down
1 change: 1 addition & 0 deletions packages/extension/src/types/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export type UserVariableType = z.infer<typeof userVariableSchema>

export const PageActionOption = z.object({
startUrl: z.string(),
recordUrl: z.string().optional(),
openMode: z.nativeEnum(PAGE_ACTION_OPEN_MODE),
steps: z.array(PageActionStepSchema),
userVariables: z.array(userVariableSchema).max(5).optional(),
Expand Down