Google: we use the canonical attribute of the initial fetch (important for JavaScript websites)

Google’s John Mueller said another thing that might be important if you have a JavaScript heavy website: Google only process the rel=canonical on the initially fetched, non-rendered version. That means that any canonical attributes that are inserted by JavaScript will be ignored by Google.

We (currently) only process the rel=canonical on the initially fetched, non-rendered version.