4
  • 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:

  1. Add a test user script
// ==UserScript==
// @name         Test Userscript
// @match        https://academic.microsoft.com/paper/*
// ==/UserScript==

(function() {
    'use strict';

    alert("Matched");
})();
  1. Search anything on https://academic.microsoft.com/home
  2. Press any result title to go to the detail page https://academic.microsoft.com/paper/*
  3. The user script won't run
  4. Refresh the website, the script runs
ChaseChoi
  • 101
  • 5
  • 2
    This is the correct behavior. This is a Single Page Application site that uses programmatic navigation. You need to match the entire site and check the URL inside using MutationObserver or other techniques described [here](https://stackoverflow.com/a/39508954). – wOxxOm Nov 26 '20 at 08:08

0 Answers0