API talk:Options

From MediaWiki.org
Jump to navigation Jump to search

List of options?[edit]

Is there a list of options that can be changed using this anywhere? Can this be used to enable or disable gadgets? --Yair rand (talk) 16:56, 18 October 2012 (UTC)

Token mode?[edit]

Is the options token cacheable for the session or even the user at all, or it is strictly one-time and must be re-obtained before any options change? -- Григор Гачев (talk) 09:58, 10 April 2014 (UTC)

I wondered the same thing and although I didn't exhaustively test it, I did grab the options token > log out > log back in > grab it again > and found that it was the same. I tried that a few times and it didn't change. Maybe it does change, but I dunno if/when. My first and only use so far grabs the token on script initialization every time and uses that value until the script is reinitializes. I'm pretty confident that'll be fine. If it isn't, I'll fix it ;-) fredgandt 23:32, 4 July 2014 (UTC)

Delete userjs-arbitrary-option-name ?[edit]

I don't suppose anyone knows how to do this?

Grab, remember and edit (delete those not wanted) the current options > reset > rewrite the list from edited memory?

Something a little less fiddly would be handy. fredgandt 23:32, 4 July 2014 (UTC)

Yes. This is actually mentioned on this page, but well-hidden, in the Parameters section: "change: Pipe-separated list of changes, formatted name=value (e.g. skin=vector), value cannot contain pipe characters. Providing only names of options without equal sign (e.g. hideminor|skin) results in resetting them.". Matma Rex (talk) 00:14, 5 July 2014 (UTC)
Yep, that works! Thanks Matma Rex :-) fredgandt 15:22, 5 July 2014 (UTC)