You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That is possible to implement on the javascript side already, but along with that, we would like to improve the current approach.
First of all, I'd like to get rid of the GM properties pre-compiled into the userscript.
Solution: separate properties set by the async API (GM_setValue) from properties set by the new async API (GM.setValue). The former will be pre-loaded, while the latter will be always requested asynchronously.
The second issue we would like to be solved is pre-compiling all the resources. This can be avoided if we make GM_getResourceUrl and GM.getResourceUrl return an URL to local.adguard.com instead of a blob. However, we should be cautious with that as we still may need to pre-compile resources if userscript uses the synchronous GM_getResourceText function.
Solution: pre-compile resources if userscript uses GM_getResourceText only.
The text was updated successfully, but these errors were encountered:
Q2: And regarding the resources loading, we can supply a list of resources identifiers to the userscript wrapper and it then will build urls like local.adguard.com/userscript/resource/HERE_GOES_ID Would you like to change/improve it somehow?
automatic transpilation would be beneficial for some users, we may use a transpiled userscript for some 'Filtered Apps' like IE or Maxton. What I can't answer is whether it is doable.
We may provide some checkbox like 'run this userscript in a compatibility mode' local.adguard.com/userscript/resource/HERE_GOES_ID
I just want HERE_GOES_ID part to be sufficiently randomized so that third-party scripts can't guess what userscripts the user have enabled.
Update by @sfionov based on discussions:
Instead of implementing full async API, currently we need only presence of functioning GM object, so we may wrap GM_ functions into it.
Original proposal by @ameshkov:
First of all, we need to provide GM4 async API support:
https://www.greasespot.net/2017/09/greasemonkey-4-for-script-authors.html
That is possible to implement on the javascript side already, but along with that, we would like to improve the current approach.
First of all, I'd like to get rid of the GM properties pre-compiled into the userscript.
Solution: separate properties set by the async API (
GM_setValue
) from properties set by the new async API (GM.setValue
). The former will be pre-loaded, while the latter will be always requested asynchronously.The second issue we would like to be solved is pre-compiling all the resources. This can be avoided if we make
GM_getResourceUrl
andGM.getResourceUrl
return an URL tolocal.adguard.com
instead of a blob. However, we should be cautious with that as we still may need to pre-compile resources if userscript uses the synchronousGM_getResourceText
function.Solution: pre-compile resources if userscript uses
GM_getResourceText
only.The text was updated successfully, but these errors were encountered: