User talk:Enterprisey/link-deleted-revs
Appearance
@Enterprisey: So, apparently links can look like &oldid=prev&diff=123456789
? I didn't know that until, like, yesterday. There are bigger ramifications, but for this, it means that
var oldid = window.location.search.match( /oldid=(\d+)/ )[1];
will error on such links. ~ Amory (u • t • c) 10:17, 29 April 2020 (UTC)
- Relatedly, since this executes on diffs that are just fine,
data.query.pages[0].deletedrevisions.forEach( function ( rev ) {
- will produce a
Cannot read property 'forEach' of undefined
error. ~ Amory (u • t • c) 20:26, 29 April 2020 (UTC)
Thank you!
[edit]I just wanted to say this is amazing. What a time-saver! Thank you :) — MusikAnimal talk 21:16, 2 May 2020 (UTC)