Pake icon indicating copy to clipboard operation
Pake copied to clipboard

[Bug] 打包notion路由跳转时候整屏幕刷新的

Open ChasLui opened this issue 1 year ago • 3 comments

Search before asking

  • [X] 我在 issues 列表中搜索,没有找到类似的内容。 I searched in the issues and found nothing similar.

Pake version

2.3.6

System version

macOS 14.3.1 (23D60)

Node.js version

v21.7.0

Minimal reproduce step

pake https://www.notion.so/ --name Notion --icon "https://www.notion.so/front-static/favicon.ico" --inject ./Notion\ Chinese.js

What did you expect to see?

期望可以正常使用notion, 不整页刷新

What did you see instead?

每次切换page都整页刷新了.

Anything else?

No response

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

ChasLui avatar Mar 07 '24 06:03 ChasLui

I was able to fix this for MacOS in src-tauri/src/inject/event.js:

  const detectAnchorElementClick = (e) => {
    const anchorElement = e.target.closest('a');
    if (anchorElement && anchorElement.href) {
      if (anchorElement.target !== '') anchorElement.target = '_self'; // <-- added this line to fix for MacOS
      ...

But it does not work for my app as Windows build via Github Actions. I am unable to debug the behavior in Windows because I do not find a way to enable the developer tools there. I tried to enable devtools like so: https://tauri.app/v1/guides/debugging/application/#:~:text=To%20enable%20the%20devtools%20in%20production%20builds Sadly, it has no effect. Does anybody know how to achieve this with Pake?

globalexport avatar Apr 05 '24 15:04 globalexport

You can open this devtools using the local debugging of Pake code, or via the command line with pake-cli, and you're also more than welcome to submit pr for support!

tw93 avatar Apr 06 '24 02:04 tw93

Hi @tw93!

Maybe this is a misunderstanding. I am on MacOS and I cannot open devtools in the Windows build on another computer. I have no Windows environment to run npm run dev to locally debug there.

globalexport avatar Apr 08 '24 07:04 globalexport