Обговорення » Розробка

Do you need GM_ functions in Firefox 57 and later?

§
Опубліковано: 14.05.2017
Edited: 14.05.2017

Do you need GM_ functions in Firefox 57 and later?

Anthony Lieuallen is seeking input from script authors on what to do about changes in Fx57 that will affect the standard synchronous functions.

It's cross-posted in two groups:

https://groups.google.com/forum/#!topic/greasemonkey-users/Va5kqhkgVG8
https://groups.google.com/forum/#!topic/greasemonkey-dev/k_CwKkxv97A

§
Опубліковано: 16.05.2017

If Anthony can't do it, so where to us

Deleted user 20822
§
Опубліковано: 16.05.2017

I just need .wrappedJSObject (unsafeWindow) and cloneInto. Both synchronous.

As @wOxxOm said, asynchronous GM_getValue and GM_setValue are pities. Other GM_ functions are trivial or can become async too.

§
Опубліковано: 02.06.2017

unsafeWindow and a way to store data (GM_[gs]etValue) are the most common GM api's I use.

§
Опубліковано: 05.07.2017
Edited: 05.07.2017
  • GM_xmlHttpRequest: If there's one I must keep, is this one.
  • GM_[gs]etValue: I can live without it, but those functions are just so handy.
  • unsafeWindow: can be work around (e.g. <script> injection, then communicate using event).

If everything has to be async: we have promise and await/async, which can help migrate.

function GM_getValue_async ( key, defaultValue ) {
  return new Promise((resolve, reject) => {
    // TODO: message passing
    resolve(666);
  });
}

let x = await GM_getValue_async ('x', 1);

I think we can get started using the new API(under different or same API name?). And in the meanwhile, Script Manager can give warning to those API calls, and finally complete the transition in the future.

Deleted user 20822
§
Опубліковано: 06.07.2017
  • GM_xmlHttpRequest: If there's one I must keep, is this one.
  • GM_[gs]etValue: I can live without it, but those functions are just so handy.
  • unsafeWindow: can be work around (e.g. <script> injection, then communicate using event).

<script> injection won't work if the Content-Security-Policy (CSP) of the website does not allow inline scripts ("unsafe-inline").

§
Опубліковано: 08.07.2017

Yep, GM_xmlHttpRequest is the only one I can't live without.

Опублікувати відповідь

Sign in to post a reply.