Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

注入的 js 只有第一次進入才會運作 #40

Open
hms5232 opened this issue Mar 20, 2022 · 0 comments
Open

注入的 js 只有第一次進入才會運作 #40

hms5232 opened this issue Mar 20, 2022 · 0 comments
Labels
help wanted Extra attention is needed theme Theme related

Comments

@hms5232
Copy link
Member

hms5232 commented Mar 20, 2022

大致上是這樣的:

先使用 injector 注入一些程式碼在文章中,例如:

<script src="/js/consoleLogUrl.js"></script>

如果我直接使用網址進入文章,這些程式碼都會正常運作;但如果我是先到首頁,再點入文章,從原始碼可以看出 <script> 標籤有正確被注入,可是 consoleLogUrl.js 部分卻沒有被執行。

測試後發現如果在原地直接重新整理網頁,則全部都會正常運作。所以是只有從其他頁面連結進入文章的時候,所注入的程式碼不會被執行。因為是我在猜可能是主題渲染方式造成的,在其他主題並沒有碰到。

@hms5232 hms5232 added help wanted Extra attention is needed theme Theme related labels Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed theme Theme related
Projects
None yet
Development

No branches or pull requests

1 participant