javascript - Tampermonkey @match not working when visit target link through redirection
问题描述
- Chrome: Version 87.0.4280.67
- Tampermonkey: v4.11
I'm trying to add a button to https://academic.microsoft.com/paper/*
. But when I search on https://academic.microsoft.com/home and select any result to redirect to https://academic.microsoft.com/paper/*
, the script won't run as expected. To trigger the user script, I need to refresh the website.
For example:
- Add a test user script
// ==UserScript==
// @name Test Userscript
// @match https://academic.microsoft.com/paper/*
// ==/UserScript==
(function() {
'use strict';
alert("Matched");
})();
- Search anything on https://academic.microsoft.com/home
- Press any result title to go to the detail page
https://academic.microsoft.com/paper/*
- The user script won't run
- Refresh the website, the script runs
解决方案
推荐阅读
- c# - c# List 到 LinkedList 的转换
- mongodb - MongoDB 使用来自另一个集合的子查询进行更新
- powerbi - 如何在powerbi中按状态获取员工人数
- javascript - 如何解析房地产经纪人 API 数据以显示财产数据(房地产经纪人 API/Rapid)?
- css - 角度材料输入文本区域仅允许新输入并禁用当前值的编辑或删除
- javascript - 建议使用一个大对象,其中键是字符串代码以便更好地访问而不是需要迭代的数组?
- jmeter - JMeter 类 javax.faces.el.EvaluationException<
- python-3.x - 设置 Pyenv 的路径
- angular - 如何在 Angular 8 中延迟加载子组件?
- swift - 无法识别的选择器发送到实例 0x7ff0ece07a40" xcode 上的错误