In tampermonkey, advanced settings, you can find a setting called "Inject mode" at the "Expirimental" tab. Here, you can select a mode called "Instant".
I was wondering, what does it do different? How does it work? Is it simular to ViolentMonkeys injection methods?
Judging by the source code in other extensions like Stylus or Violentmonkey (beta) that recently added the same feature:
Blob
in the background script with the data, gets its URL via URL.createObjectURL
, puts it into a Set-Cookie
header via chrome.webRequest API.document.cookie
and uses it in a synchronous XMLHttpRequest to get the original data synchronously.This trick is based on an answer by Xan.