User talk:Joeytje50/JWB/Archive 1

Archive 1

Confusion - help needed

I'd like to run the JavaScript Wiki Browser script on a(n external) wiki, but don't understand the isntuction on this page.

"After installing the script, simply go to this page to run the script. For users using the script on another wiki, simply go to the page Project:AutoWikiBrowser/Script on the wiki you'd like to start the script on, and have installed the above code on."

The page Wikipedia:AutoWikiBrowser/Script doesn't exist. Thanks! Danapit (talk) 17:54, 24 October 2018 (UTC)

Which wiki are you trying to use JWB on, and have you put it in Special:MyPage/common.js on the wiki you want to edit or meta:Special:MyPage/global.js? JWB works for me on Danish Wikipedia, even though da:Wikipedia:AutoWikiBrowser/Script does not exist. Kranix (talk | contribs) 20:19, 31 December 2018 (UTC)
Yeah, I had the same problem, but it got fixed after I switched to the second installation method (using {{subst:iusc|User:Joeytje50/JWB.js/load.js}}). – Uanfala (talk) 14:39, 5 May 2020 (UTC)

Keyboard shortcuts

Does the tool have keyboard shortcuts? I see tooltips with single letters when I hover over buttons but not sure how to activate them, if so. czar 00:24, 24 December 2018 (UTC)

Alt+Shift+[the key in the tooltip] should work. Kranix (talk | contribs) 20:15, 31 December 2018 (UTC)

"Save to wiki" error

Getting "API error: Invalid CSRF token" when I attempt to "Save [the setup/settings] to wiki". Any guidance? czar 21:36, 23 December 2018 (UTC)

AWB permission for JWB?

Do I need wp:AWB permission to also run wp:JWB?--Dthomsen8 (talk) 03:41, 5 January 2019 (UTC)

To use this script, you need to be listed on the wiki's AutoWikiBrowser CheckPage

@Dthomsen8, yes czar 03:43, 5 January 2019 (UTC)

Styles

I've been using JWB heavily on English Wiktionary because I'm using Linux and don't want to figure out how to run AWB.

The editing tab does not look right on my computer. For me, the CSS rule .viaJWB #summary { width: 170px; padding-right: 90px; } for the edit summary box means that the visible area of the edit summary box is cut off halfway across (i.e., the text of the edit summary is cut off halfway). I keep having to remove these styles in my browser's Inspector window because I can't figure out how to override them with a CSS rule in my common.css. Maybe removing this rule would improve things. I'm not totally sure because the order in which I delete each property (the width and the padding-right) changes how the edit summary box is displayed. If I delete padding-right first, it gets screwy. So who knows what removing the rule from the stylesheet would do.

Another problem is that the "via JWB" label is floating to the left of the edit summary box, far away from the checkbox on the right that it's meant to be labeling. Not sure how to fix that.

Screenshot

Besides this, thanks for JWB because it's working great for me. — Eru·tuon 02:37, 5 April 2019 (UTC)

@Erutuon: Thanks for reporting this, and apologies for the very late reply. I have fixed this issue now, after finding out that this is an ancient FF bug. For now, everything should work just as intended, so the problems you've got should be gone now. The reduced width of the text box was actually intended, as the greyed out overlay was supposed to be on top of that. Joeytje50 (talk) 01:08, 10 October 2019 (UTC)

Regex typo fixing not working

@Joeytje50: I've checked the "Enable RegEx Typo Fixing" box, but the rules do not seem to be applied. For example, I added Thi to my article list, and when loaded JWB makes no changes to this article. But the rule word="it is" should be kicking in because "it it" appears on the page. I can make this change in JWB if I fill in the manual "Replace:" and "With:" fields. Is the script in need of repair or am I doing something wrong? Thanks! -- Beland (talk) 18:08, 1 June 2019 (UTC)

Hi Beland, thanks for reporting this. This is however fully intentional behaviour implemented in this script, as this behaviour was copied directly from Wikipedia:AutoWikiBrowser/Typos#AutoWikiBrowser (AWB). Any text following a colon or asterisk is ignored in the regex typofix. I don't personally know why this is, but since this typo fix list was constructed for AWB, I wanted my script to mimic the behaviour that has as closely as possible to prevent false positives. You could ask the developers of AWB why they ignore any text behind colons, or you could try running typofix on that page (or any page containing a typo with a colon anywhere before that) and seeing what it does.
Of course I might be wrong in my implementation, and perhaps the rule should be that any typoes "following a colon or asterisk at the start of a line" should be ignored (ie. indented or listed text), in which case I'll fix that. For now though, I'm afraid I'm going to refer you to the devs of AWB to explain the reasoning behind ignoring all such text.
PS: for now, I've manually fixed that typo. If you want to test this, I recommend copying and pasting the entire line that had this typo on it to WP:SBX and trying to run JWB or AWB on there.Joeytje50 (talk) 00:05, 10 October 2019 (UTC)
Ah, thanks for the explanation. I do see regex fixes kicking in on other pages from time to time. -- Beland (talk) 00:29, 10 October 2019 (UTC)

Draft space exemption?

Would it be possible to code an exemption from needing to be 'authorized' to run JWB script in the draft space or your own userspace? The idea would be that this could be added to {{draft article}}/{{userspace draft}} and provide a resource to newbies to cleanup common mistakes. Although if you need to install the script anyway, that would not be very useful. Headbomb {t · c · p · b} 22:52, 10 July 2019 (UTC)

Headbomb I'm not sure if such a thing is possible to do securely. Currently I've made the entire script destroy itself on discovering the user running it is not on the CheckPage. If I would change that behaviour, I think it would be a lot easier to change one variable somewhere and have access to the full script, instead of just the script on draft articles. So, I think allowing things like that would be a security risk. I'm sorry about that, but I think that if you have legitimate use for the script you can always request usage on the checkpage itself. I hope you understand.
PS: Since my script version is fully open source and javascript-based, it is much more vulnerable to modifications like the one I mentioned. You could try asking the developers of the downloadable AWB, which is much more closed to tampering, and therefore would be less easily exploited this way.Joeytje50 (talk) 23:20, 9 October 2019 (UTC)
I get that security is an issue, but WP:JWB is localized on Wikipedia, so I don't see how anyone could hijack that to wreck havoc. Either way, not super super important, but it would be nice to have access to one-click genfixes for people that are intimidated by AWB. Headbomb {t · c · p · b} 23:30, 9 October 2019 (UTC)
Headbomb The fact the script is localized on Wikipedia is not entirely true. I know of several other wikis that also use a checkpage similar to WP:AWB/CP, which keeps users from using the script unless they're on that page. Even if it was localised to (English) Wikipedia, though, it would still be an issue to grant every user access to this script. The AWB check page was created to prevent unapproved users from editing too many pages in too short of a time.
Regarding your comment 'one-click genfixes for people that are intimidated by AWB', do you mean that AWB does work on such draft pages and/or users' own userspace? I can't find anything on WP:AWB about that. Also, my comment still applies, that if you want to perform large amounts of edits to pages on wikipedia, you should request access through the checkpage. That page is also checked by JWB for access, so if you're on that page, you can also use JWB automatically. So even if you're intimidated by AWB, you can simply request access on that page, and use the access to edit with JWB.
I hope this helps. Joeytje50 (talk) 00:11, 10 October 2019 (UTC)
AWB works on any page you want it to work. Currently genfixes aren't enabled in Draft space with AWB, but it's a matter of no one having done the coding tweaks, rather than lacking consensus do enable them. Headbomb {t · c · p · b} 02:48, 10 October 2019 (UTC)

JWB Userbox

Hi, I just created User:Joeytje50/JWB/Userbox. Feel free to move it, change the icon or whatever. – Fayenatic London 19:49, 12 July 2019 (UTC)

Fayenatic london, (talk page stalker) Thank you for creating this. This is really an appreciable one. Regards. PATH SLOPU 14:22, 14 August 2019 (UTC)

JWB edits to redirects are confusing

Hi Joey, when I use JWB to edit redirects, it shows the target page on the left as if that is the "before" page that I am editing, and shows changes as if I am removing all the content from that target page. This is confusing and disconcerting. Hope you can fix it. – Fayenatic London 12:09, 24 July 2019 (UTC)

Hi Fayenatic london, thanks for reporting this. I think this has something to do with some update to the API, since this once used to work just fine, and the API help also claims that redirects=0 should be sufficient to not follow redirects (which should apply to the revisions just as well). I think it has something to do with the fact that, according to the revisions API, the rvdifftotext API I use is now deprecated. I'll have a look at it some time soon and I'll try to fix this. I admit it does indeed look a bit weird to see the incorrect diff. I hope it hasn't bothered you too much the past while. Joeytje50 (talk) 23:42, 9 October 2019 (UTC)
Ooh, I think I can handle the stress of it for now! Having realised that it's misleading, I can just ignore it. However, other users who stumble across it will lose time figuring that out. – Fayenatic London 09:39, 10 October 2019 (UTC)

"Ignore unparsed content" seems to stop editing stuff that is inside of templates

User:Joeytje50 hi! My bot using this was approved for trial. However, I've run into a problem: with "ignore unparsed content" on, links within templates are ignored. On the article South Korea, if I have the option off, the regex ((?<!\?)(?<=url ?= ?)|(?<=\[)|(?<=>))(http:\/\/)?(www\.)?articles\.latimes\.com matches a link in a template. However, if I have it ignored, the link is not edited.

Looking at your information about this option, I see "elements such as quotes and links will not be ignored with this mode." However, this is not true for links in templates. How can I ignore unparsed content and edit links in templates? Is this a glitch, or would it need a special regex/a separate option to be added to be able to do this? Because I won't be looking at the edits, I need to automatically ignore stuff in <nowiki> blocks, so this is crucial to my bot. Thanks! DemonDays64 | Tell me if I'm doing something wrong :P 00:25, 5 December 2019 (UTC)

Now that I think about it, I realize I don't actually need this option on in the first place; my regex is limited to only cases with the url in a ref tag (e.g. <ref>http://example.com) or links (e.g. [1]) or in a template (e.g. url=http://example.com). DemonDays64 | Tell me if I'm doing something wrong :P 14:40, 5 December 2019 (UTC)
@DemonDays64: Sorry for the very late reply. I'm glad to hear you've already found a solution. I did want to reply to your question if this is a glitch: it kind of was. The problem was caused by the regular expression not having the g flag applied to it. Because of that, the specific expression that excludes unparsed content was triggered on an earlier occurrence of something that needed to be skipped (e.g. a comment) which prevented it from reaching your matched links. I've now fixed it so that the script will do exactly one replacement if the g flag is not specified, as would be the behaviour if the regular expression is run without the 'ignore unparsed' rule. In your case, you'd probably benefit from enabling the 'g' flag, though. Thanks for reporting this problem!Joeytje50 (talk) 13:58, 5 May 2020 (UTC)

I don't see the option to automatically save edits

According to User:Joeytje50/JWB#Editing options, "Users with the bot usergroup will also be able to automatically save their edits. This can be done with a throttle to prevent overloading the server. The number entered in the "every [] sec" field is the number of seconds between edits. This number can also contain decimals (using a . as decimal mark)."

However, I don't see this option. My bot is in the bot usergroup since 16:27 UTC (see [2]), so it should have this option. What's up? Should I blame caching? If so, how long should it take for it to get the ability to save edits automatically? Thanks! DemonDays64 (talk) 17:10, 8 December 2019 (UTC)

Still happening now. DemonDays64 (talk) 21:06, 10 December 2019 (UTC)

@DemonDays64: The documentation is not quite accurate. Your bot account both has to have the "bot" usergroup and be listed in the "Bots" list in Project:AutoWikiBrowser/CheckPage, if that page exists and has a "Approved users" list marked in a certain way. Since your bot account is only in the "Approved users" list, it can use JWB, but not the bot-only features. So you will have to get your bot's username added to that list, however that's done. — Eru·tuon 01:29, 11 December 2019 (UTC)
@DemonDays64: Thanks for mentioning this. Erutuon is completely correct in what he's said. I've edited the documentation to also mention what he said, so it'll be more clear to users in the future.Joeytje50 (talk) 14:05, 5 May 2020 (UTC)
@Erutuon: Thank you very much for replying to this message and clarifying this.Joeytje50 (talk) 14:05, 5 May 2020 (UTC)

Three things

Hey, great tool! I've found three possible bugs, it'll be cool if they're fixed:

  1. Reset page list doesn't work on my browser (Chrome, Mac). May be minor because Ctrl+A and Backspace can also delete list, but it took me a while to understand I can do that.
  2. It's possible to add new expressions for find and replace, but once I added an item - it can't be deleted (if I leave it empty, it still works; but it bothers a bit).
  3. Most important bug - when using a regular expression, only the first occurrence of the regex is replaced for some reason. Maybe it can fixed with some flag, but the flags areas is not so clear - what are the possible flags to use?

Thanks, Tomer T (talk) 09:00, 1 April 2020 (UTC)

Tomer T, 1 reset is used for pre-parse mode, it doesn't reset generate list. 2 every refresh deletes the regexes so empty field won't remain for long. If you use the same replacements from session to session, you can edit the settings json to remove the empty ones. 3 The flags are JavaScript flags, to replace all occurrences add g. Uziel302 (talk) 12:40, 9 April 2020 (UTC)

Thanks

I was able to use this when the original AWB was not working for me. --User:Ceyockey (talk to me) 01:08, 19 April 2020 (UTC)

Time pad0 doesn't work

On hewiki I added +1 to the line:

return n.length < len ? Array(len-n.length+1).join('0')+n : n;

and it solved it. Uziel302 (talk) 10:26, 5 May 2020 (UTC)

Stopped working in Puffin browser

Hi, I have been using JWB regularly in Puffin Browser on iOS, but I noticed yesterday that it no longer works. The link in the navigation panel opens the page Wikipedia:AutoWikiBrowser/Script but just shows a notice that "This page has been deleted". In other browsers, that notice appears briefly before JWB launches. – Fayenatic London 10:24, 6 May 2020 (UTC)

@Fayenatic london: Thanks for letting me know; however, I myself have no access to any machine running iOS, nor do I have a subscription of a tool that allows me to test pages on other browsers (like BrowserStack or something). I'm currently working from a Linux computer, and I can't find any way to install Puffin on Linux.
If you want, you can check in your developer's console, and give me a link to a pastebin (or any other paste site) to check out what is going wrong exactly. Otherwise, I think I don't have an easy way to fix the problems you're having. If that's the case, I recommend using either Chrome (or Chromium) or Firefox, since I have easy access to those browsers, so I can easily debug any problems that may arise on those browsers.Joeytje50 (talk) 23:05, 6 August 2020 (UTC)

Issues with character encoding charts and non-NFC forms.

In contexts specifically pertaining to character encodings, it is sometimes necessary to discuss Unicode code points (or list mappings to code points) which do not appear in NFC Unicode normalization form. In these cases, the hexadecimal code points will usually be quoted, along with a preview of the character. In these cases, a reader will natually expect that character to be that code point, i.e. that a reader will be able to copy and paste it under the assumption that they are copying and pasting that code point. However, the text appears to be converted to NFC form upon saving, which is usually wanted behaviour, but not in the case of needing to display the character corresponding to a particular, quoted, code point.

So we end up with situations of, for example this edit reversing the escaping of U+2126 and U+212B which had been deliberately put in place by this edit so as to address the mismatch between the displayed codepoint (in turn selected to match the mapping behaviour of actual vendors and implementations, see Apple, Microsoft, IBM) and the actual codepoint of the displayed character.

This is not limited to code points quoted in mapping tables per se; see, for instance, Symbol (typeface) § Encoding, where they are quoted in a paragraph discussing other documented mappings to the ones listed in the table.

In any case, it might be appropriate to put in place a check that if an escaped character cannot appear in NFC normalised form, but its hexadecimal code point is quoted (with or without U+) within (say) 64 characters either side of the entity itself, it shouldn't be replaced with a literal character.

--HarJIT (talk) 10:32, 25 May 2020 (UTC)

@HarJIT: I'm afraid I can't help you fix this problem, because this job is not a built-in job my tool can do, which means it is a job User:Beland has created by himself. Because of that, any issues with the replacements Beland made should be taken up with them. JWB is simply a tool that makes it possible to perform repeated edits more easily; as the notice at the top on User:Joeytje50/JWB says: it is their full responsibility to perform these edits correctly.
Of course that is not to say messages like this one are always in the wrong place. It could very well have been a built-in function, in which case it would have been my responsibility to fix it. In this case, however, I can't help you with this. Joeytje50 (talk) 22:59, 6 August 2020 (UTC)
Given the broader needs to leave characters in articles that document character encodings or discuss specific characters, I am accumulating a list of articles that will be skipped when I'm analyzing database dumps, and these article are now on it. I do review all the changes manually; now that I know the NFC thing happens I keep an eye out for that on these types of pages. I'm sure as a result I'm going to have to squint at a lot of ideographs before this project is done. 8) -- Beland (talk) 04:09, 7 August 2020 (UTC)

Save settings as a json subpage?

Hi! I have a suggestion: consider saving the settings at JWB-settings.json instead of JWB-settings.js, so MediaWiki provides a nice representation of the JSON config (random example: User:Yapperbot/COVIDdata.json). Helder 14:11, 4 July 2020 (UTC)

As an experiment, I changed the content model of my JWB-settings.js so it displays as JSON, which you can see at User:Ahecht/JWB-settings.js. It might present a problem with page length for larger config files, but even for one as long as mine it seems to be okay. Not sure if Joeytje50 will see this, as he hasn't edited in a couple of months. --Ahecht (TALK
PAGE
) 14:29, 4 July 2020 (UTC)
@He7d3r: and @Ahecht: Doing this would bring with it compatibility issues, because I'm not sure every wiki installation currently supports json userpages. Is there any place I can find out which version of MediaWiki started supporting .json userpages, so that I can be sure implementing this will not suddenly break this tool on several other wikis?Joeytje50 (talk) 13:25, 6 August 2020 (UTC)
I believe the usage of the JSON content model started in 2014. Helder 13:53, 6 August 2020 (UTC)
@He7d3r: I've just checked, and it looks like Fandom.com does not support json subpages at all. I already knew they were stingy on the *.js pages (by completely disabling user access from them), but it looks like they completely lack support for *.json subpages, considering I was able to edit it with my other account. That would make it very insecure on any wiki that does not support this. I know I could simply make a workaround that forces another page for the fandom.com domain (in fact, I already have such a workaround to use *.css instead of *.js there), but because I am convinced this is not a fandom-only problem, but more likely a MediaWiki-version problem, this seems to me like a very bad solution.
Due to the fact a lot of things MediaWiki uses are named *.json, I'm having a hard time finding the actual MediaWiki version and/or extension that created these protected .json userpages. Because I want to be able to guarantee to JWB users that their settings cannot be vandalized, I don't want to implement use of these .json subpages until I can be absolutely sure that this would not in any way make other wikis unsafe. If you are able to link me to a page describing what MediaWiki-version I can test for in order to guarantee proper functioning of these subpages, I'd be happy to implement a new system that uses these subpages. Otherwise, I feel like it would be dangerous to simply implement this as a feature, assuming everything except for fandom.com supports this. Joeytje50 (talk) 00:02, 7 August 2020 (UTC)
@He7d3r: @Ahecht: More recently, apparently Fandom got their feces together and managed to implement this 6-year-old feature to their wikis. With that I saw no objections to implementing the JSON subpages and the settings should be moved to the new location on the first startup of JWB. Joeytje50 (talk) 00:29, 20 March 2021 (UTC)

I'm receiving the message Please request the page's content model to be updated to JSON by an administrator. I understand why, but what's the best place to make such a request? Certes (talk) 15:00, 2 March 2021 (UTC)

@Certes: My guess is that you'd probably have to check Wikipedia:Edit requests and follow the procedure explained there. I'm not sure which template would be best suited, but adding one of those templates (whichever seems most relevant to you) to your JWB-settings.json subpage's talk should probably be sufficient.Joeytje50 (talk) 00:29, 20 March 2021 (UTC)

Problems saving settings

I have been having some issues saving or downloading my JWB settings. If I try to save to wiki I get a popup saying 'API error: "Invalid CSRF token"' and the downloading feature just doesn't seem to do anything. Any ideas how to fix it? I've managed to use it before. --Trialpears (talk) 16:30, 21 July 2020 (UTC)

@Trialpears: Where is this happening, and with which browser? I'm not experiencing this problem myself, so in order to try to fix this I'm going to need a bit more information to start looking into a source of the problem, and then try to fix it. Joeytje50 (talk) 13:27, 6 August 2020 (UTC)
Huh, it's working now when trying to save basically the same setup today, but it wasn't working for at least a week when saving this setup where I did it manually. I use Firefox Version 79.0 for Windows 10. Will give you an update if the problem returns. --Trialpears (talk) 21:33, 6 August 2020 (UTC)

HTTPS security

You replace HTTP by HTTPS while HTTP allows cache and HTTPS makes the server to have the list of readers...

Also numerous servers use various technologies (such as cookies) to share user experience, habits and interests with their partners.

So, HTTPS, for which benefit? — Preceding unsigned comment added by 88.136.214.5 (talk) 07:34, 25 July 2020 (UTC)

@88.136.214.5: I'm not really sure what the problem is. There are many benefits to using HTTPS, most of which can be found through a quick Google Search. Regardless of all that, though, I made this tool entirely on sites that use HTTPS, so I have never experienced any problems with HTTP/HTTPS differences. If you are having trouble running this on your local wiki, please let me know what issues you are having exactly, and then I can have a look at fixing it. Joeytje50 (talk) 23:33, 6 August 2020 (UTC)

Style

@Joeytje50, Hi. I uploaded a script to work in ruwiki. The interface was broken (specifically the central settings window), which made the work impossible.

Perhaps you need to either change the CSS, or change the translation into Russian. I saw that one of the tasks for the future (TODO) involves solving a problem with the language versions, but it has already occurred now.

Now I had to change Special:Preferences language settings for the whole site as a temporary fix. Ailbeve (talk) 17:53, 8 November 2020 (UTC)

@Ailbeve: I'm sorry to hear things are not working for you, but going by these messages I'm not really able to do anything about this. In order to fix this, I will need a bit more detailed information about what is going wrong exactly. Could you please provide me with a bit more information?
As a solution to having to change your language in your preferences, you could change just the JWB interface's language by adding ?uselang=en to the end of the URL. That will turn the page into English, which would show the English interface.
I'm looking forward to more information on what is going wrong. Joeytje50 (talk) 01:29, 14 November 2020 (UTC)
Okay, it worked. What is the best way to make a link in the bar on the left by default with this (?uselang=en) parameter? Ailbeve (talk) 09:14, 14 November 2020 (UTC)
@Joeytje50 Ailbeve (talk) 15:14, 22 November 2020 (UTC)
@Ailbeve: You could copy the first three lines of code (below the comments) on the load script and add that url suffix as a part of the "Project:AutoWikiBrowser/Script" string (turning it into "Project:AutoWikiBrowser/Script?uselang=en"). Joeytje50 (talk) 23:03, 23 November 2020 (UTC)

"API error: One of the parameters "cmtitle" and "cmpageid" is required."

I just got this warning when trying to generate a page list from a category. My settings page User:Reywas92/JWB-settings.json has "cmtitle":"" but not "cmpageid" and I'm not sure what is supposed to be added as a parameter here. This was just auto-moved from User:Reywas92/JWB-settings.js when I opened JWB but no other changes since I've use this generation recently, so how would I fix this? Thanks! Reywas92Talk 08:28, 16 February 2021 (UTC)

I have the same problem. Nadzik (talk) 18:34, 21 February 2021 (UTC)
Having the same issue as well. Pbrks (talk) 04:26, 1 March 2021 (UTC)

This seems to have been resolved, but generating a list with "Links on page" does not add anything to the edit list and no error pops up. — Preceding unsigned comment added by Reywas92 (talkcontribs) 06:30, 17 March 2021 (UTC)

I have now fixed the issues with generating pagelists based on links on pages. Joeytje50 (talk) 00:32, 20 March 2021 (UTC)

Program freezing with "Applying replace rules"

I'm running one simple replacement (regex) that was worked very quickly on JWB in the past, but now when I run it doesn't load the page to be able to skip or save, rather continually says "Applying replace rules". If I stop and start again it will quickly apply the rules and the page will be ready, but after the first page it again continually attempts to apply replace rules until I stop. I've changed the regex time limit and other parameters but can't figure out how to prevent this. Thanks! Reywas92Talk 05:01, 22 February 2021 (UTC)

Reywas92 same thing happens to me. Hopefully will be fixed.--87.68.192.172 (talk) 01:08, 12 March 2021 (UTC)

Failure at Wikisource in the Page namespace

This tool doesn't work in the Wikisource Page namespace, because the header and footer fields don't contain numbers in their diff header lines. This fixes it for me (at least I can progress). @line 290:

        $('.diff-lineno').each(function() {
            var lineNumMatch = $(this).html().match(/\d+/);
            if (lineNumMatch) {
                $(this).parent().attr('data-line',parseInt(lineNumMatch[0])-1).addClass('lineheader');
            }
        });

Thanks for the great tool! Inductiveload (talk) 17:52, 3 March 2021 (UTC)

@Inductiveload: Thanks for the suggestion, hopefully my change fixed your issue! Joeytje50 (talk) 23:50, 19 March 2021 (UTC)

Generating pages

Please make it possible to generate pages from articles' urls instead of just their titles, as it's quicker. Thanks for the great tool, Somnifuguist (talk) 03:40, 12 March 2021 (UTC)

If you have a list of urls you should be able to do a find-and-replace in Word or within an edit screen to just remove instances of "https://en.wikipedia.org/wiki/". — Preceding unsigned comment added by Reywas92 (talkcontribs) 06:30, 17 March 2021 (UTC)
@Somnifuguist: When would that be quicker?Jonteemil (talk) 23:36, 15 June 2021 (UTC)
@Jonteemil: It's quicker for me as a) copying urls is an ingrained behaviour and b) highlighting a url to copy takes 1 click vs 3 clicks for a page's title. The former is the main issue as almost every time I use JWB I end up pasting a url before realising that it doesn't work. —Somnifuguist (talk) 08:24, 16 June 2021 (UTC)

Regex typo fixes slow

Thanks for the welcome recent changes. After a few months away from JWB, I've noticed that "RegEx Typo Fixing" now seems to take much longer: typically a minute at 100% CPU rather than the second it took before. AWB doesn't have the same problem, so I don't think it's a rogue typo regex. JWB continues to perform swiftly with typo fixes disabled. Certes (talk) 00:33, 15 March 2021 (UTC)

This is the same issue I have at #Program freezing with "Applying replace rules", I can do regular replacements just fine, but any regex changes make it impossibly slow to use. It similarly freezes on "Applying replace rules" if "Ignore unparsed content" is checked, which is nice to use. Thank you Joey! Reywas92Talk 06:30, 17 March 2021 (UTC)
@Certes: I believe I have fixed the issue with the RETF being significantly slower. This was likely due to an issue with a recent addition of ignoring lines that contain {{sic}} for typos. I'll have a look at another way to implement that, which doesn't cause it to slow down the whole tool. I have tested a few pages and going by those the typo fixing is fast again now.
@Reywas92: I'm not entirely sure what would be causing the unparsed content issue. Could you provide me with a page and replacement rule that would allow me to reproduce the issue? Alternatively, you can link me to a JWB-settings.json page for your bot which has settings that get executed slowly (just tell me which setup I'd have to load from the 'setup' tab). Joeytje50 (talk) 23:50, 19 March 2021 (UTC)
Joeytje50, My page is User:Reywas92/JWB-settings.json; I'm not using stored set ups here, just the default and then manually input the replace parameters since I don't usually reuse the same ones. It's whenever there are multiple pages listed, the first one will open as normal, then after save/skip it forever tries to open the second page whenever any "regex" box checked among the rules. So I had in my list Pathé and Robert Cray with the replacement rule (\d\d\d0)'s --> $1s, with Regular expression checked and 'g' (everything else default but changing them has no effect), I opened and saved Pathé with edits, but then it moves to highlight Robert Cray with "Applying replace rules" at the bottom indefinitely and no edit loading. If I stop the run and restart, it loads the page immediately. Increasing the RegEx time limit doesn't change anything. I can put in literally any random replacement on any article, and it'll load and save/skip the first one fine, but when Regular expression is checked it simply will not load the second or subsequent pages without restarting the run. Without it checked there are no issues at all.
It's the same with the unparsed content box but I've realized that doesn't exclude references (I don't want to change any source titles!) so I don't care about that so much, but regex is necessary! I'm on Chrome if that might matter. Reywas92Talk 00:49, 20 March 2021 (UTC)
@Reywas92: The issue should be resolved now. Let me know if you experience any further issues (or if this issue persists for you). Joeytje50 (talk) 02:27, 20 March 2021 (UTC)
That seems to work, thank you so much!!! Reywas92Talk 04:58, 20 March 2021 (UTC)

Save edits in AJAX

Currently, when I make an edit I have to wait until it is saved before I get the next edit, I would love to see asynchronous mode where save button sends the edit to server but doesn't wait for response and goes right away to the next article. Uziel302 (talk) 06:00, 31 March 2021 (UTC)

I've just implemented this. I'm curious to hear feedback, so please let me know if you run into issues due to this change. It should all work just as it did, though. Joeytje50 (talk) 09:16, 4 April 2021 (UTC)
Joeytje50, it still waits a second from article to article, maybe you can save in cache the next article so once I hit save, the next article is loaded from cache instead of getting it from server. Uziel302 (talk) 03:49, 17 April 2021 (UTC)
To be honest I don't think a change like that is really within the scope of the upcoming changes I would be working on, for now. I think such a system would require me to stop using just the present state of JWB, and also take future states into account, which would bring complications along with it when it comes to practically editing. I wouldn't want to make such a significant change without first carefully considering the consequences of such a change, and making sure the systems used by JWB are solid enough to be able to properly handle that without causing unexpected changes when editing. Joeytje50 (talk) 12:41, 18 April 2021 (UTC)

Precedence of multiple replace rules?

I have two replacement rules like:

  1. /foo bar/ -> foo barz
  2. /foo (\w*)/ -> foo $1s

i.e. rule 1 is a special case of rule 2. Is there any way I can make sure that 1 has higher precedence (so "foo bar" gets replaced by "foo barz" rather than "foo bars")? I thought putting it first in the order of the replacement rules would do this, but it doesn't seem to work. Colin M (talk) 19:17, 25 April 2021 (UTC)

I think both rules trigger here, in order: rule 1 converts "foo bar" → "foo barz" then rule 2 converts "foo barz" → "foo barzs". Certes (talk) 19:27, 25 April 2021 (UTC)
The replacement at the top of the list is run first and then it proceeds down the list. The result will however be foo barzs in both cases. Try changing condition 1 to "foo bar\b" to solve this. --Trialpears (talk) 19:48, 25 April 2021 (UTC)
Ah, that makes sense. Thank you both for the help. Colin M (talk) 23:55, 25 April 2021 (UTC)

Landscape instead of portrait

@Joeytje50 Can you ensure that this always loads on landscape mode instead of portrait, especially on mobile devices, as it doesn't function very well, with a very small edit area and a general decrease in functionality, or improve the portrait view functionality. Thanks! —Qwerfjkltalk 15:29, 27 June 2021 (UTC)

Qwerfjkl I'm sorry but I did not design JWB to be used on mobile devices, due to the relative complexity of the interface when compared to the plain text edit box for wikis. I think it's better to have the interface intuitively convey the information that it was not designed for mobile, by not having a mobile interface. That way, editors using their phone to use JWB will understand to take extra caution when using the tool. I also want to point out that enforcing screen orientation is far from trivial in browsers (since JWB is not a standalone application). This also adds to the complexity of this request. I hope you understand that for these two reasons I won't be implementing this. If you want, you could contribute to the script through Github (as described on the documentation page) with any changes to make mobile editing through JWB more pleasant, though. Joeytje50 (talk) 13:17, 31 July 2021 (UTC)
@Joeytje50 It works fairly well in landscape mode (I've made ~2000-3000 edits via JWB). ―Qwerfjkltalk 13:26, 31 July 2021 (UTC)

Feature request: skip typos once

I often run with "Enable RegEx Typo Fixing" checked but find it inappropriate for a few articles. (There may be olde worlde texte which we don't want to modernise, or a data section requiring multiple commas.) Currently I click Stop, uncheck Typos, Start, Preview/Save as normal, ignore the next page which gets loaded, Stop, check Typos again and Start. A button to reload the current page with RegEx Typo Fixing disabled, but to keep it enabled for the rest of the list, would be a real timesaver. Certes (talk) 00:11, 15 July 2021 (UTC)

Certes I've added a button which appears whenever RETF is enabled, which can be clicked when editing a page. Clicking it will reload the page contents without RETF activated. If for some reason you wish to then apply typo fixing anyway, after having disabled it, simply stop and restart JWB to reapply RETF. Joeytje50 (talk) 13:17, 31 July 2021 (UTC)
Thank you, that does exactly what I'd hoped and will be very useful. Certes (talk) 13:27, 31 July 2021 (UTC)

Converting to JSON checkpage - 'patch' done

I've converted the script to use the JSON checkpage here (diff between live and dev) - leaving this here for whenever we want/need to switch over. Courtesy ping @Trialpears: who asked me to have a look at this. :) firefly ( t · c ) 10:55, 21 July 2021 (UTC)

Firefly Thanks! There are four cases that can happen here as far as I can tell, the user do not have access and should not have access, the user is an admin and have access that way, the users is a non-admin on the list and finally the user is a bot and is listed as such. The first three worked as expected but PearBOT II does not have access after this change. --Trialpears (talk) 16:58, 21 July 2021 (UTC)
Trialpears, hmmm - thanks, I couldn’t test that as I didn’t have a bot on the list. I’ll check it. firefly ( t · c ) 17:06, 21 July 2021 (UTC)
Trialpears, should work now - give it another go. firefly ( t · c ) 12:39, 24 July 2021 (UTC)
Firefly, LGTM. I'll add an edit request as Joey appears to not be currently active. I've pinged them about this before. --Trialpears (talk) 14:33, 24 July 2021 (UTC)
Trialpears, thanks! :) firefly ( t · c ) 14:36, 24 July 2021 (UTC)
For the IAdmin that implements this, this is now the relevant diff, to the latest revision of User:Firefly/JWB dev.js. Thanks! firefly ( t · c ) 16:41, 24 July 2021 (UTC)
  On hold I've sent a request to this user, as this is a personal userscript and they are not completely inactive. — xaosflux Talk 18:01, 24 July 2021 (UTC)
Firefly This looks like a very nice change, thanks for taking the time to improve the script! Actually using JSON for the checkpage instead of having to parse XML is a lot cleaner, so I appreciate this being possible now. However, before I apply this change to JWB I've got one concern: these changes are not backwards-compatible for wikis that currently only have an XML checkpage. Because this script is being imported from ENWP to many other wikis (e.g. on other language Wikipedias, Fandom wikis, and the RuneScape Wikis, to name a few I know of), I would not want to suddenly drop support for this.
If AWB has officially deprecated the XML checkpage, then I would like to implement this change, but fall back on the legacy code for wikis which have no JSON checkpage, which do have an XML version. Any sysop user would then get an alert() notifying them of the deprecated checkpage format, and where to find more information. If AWB still fully supports both formats, I think JWB should as well, meaning that both checkpages should work. If that is the case, I'm not sure on the specifics if both checkpages exist: would just the JSON list get used in that case? Or would the two lists get unified into a single list?
I'd like to hear back from you if you have some more information, or know where I can find this information (I couldn't find much information on WP:AWB or its subpages). Joeytje50 (talk) 23:37, 27 July 2021 (UTC)
Joeytje50 Most discussion has been at Wikipedia talk:AutoWikiBrowser/CheckPageJSON. All currently enabled versions of AWB should only support the JSON version. --Trialpears (talk) 23:48, 27 July 2021 (UTC)
Trialpears I've made an addition to the script where, if there is no CheckPageJSON page, and the user is an admin, the script checks if there exists a non-redirect CheckPage page for AWB. If it does exist, it assumes the wiki does require a checkpage, but did not yet port the checkpage to JSON, so it gives an alert message (again, only alerting sysops about this). The addition can be found at this diff. I'm not sure if there is a better page to 'link' users to, other than the current enwp checkpage as an example checkpage? If there is any page that has instructions on how to set up a checkpage, I'd love to link users to that instead.
The reason I do want to include a notice like this, is because this is a non-backwards compatible change with no transition period where both pages are supported. Without such a notice I feel like people might be confused why some things suddenly changed for them (and admins should be aware of the changes to their wiki). I'd like to hear what your thoughts about such a notice are (and about possible ways to make the notice more informative and/or link to a clearer page). Joeytje50 (talk) 16:39, 28 July 2021 (UTC)
So the JSON checkpage isn't in use at all in this version? I think it sounds like an alright transition solution, but a full transition should ideally occur quite soon. --Trialpears (talk) 16:51, 28 July 2021 (UTC)
Correct; right now it's based solely on the old /CheckPage page, since I was not aware of AWB's transition to the JSON page. I'll probably be implementing these changes at some point tomorrow. Joeytje50 (talk) 20:11, 28 July 2021 (UTC)
I have applied these changes and they are currently live. If there are any issues with the way this is handling the checkpage, please let me know. Joeytje50 (talk) 13:17, 31 July 2021 (UTC)

Edit summary scroll

My edit summary box no longer scrolls; I always see the first 30 or so characters. I can add a longer summary but am typing blind with no way to see the text (other than select all; copy; paste to elsewhere). Do others see this behaviour too, or have I broken something locally? It may be an artefact of Firefox 90, which changed the appearance of many UI elements. Certes (talk) 12:51, 31 July 2021 (UTC)

Certes I'm sorry, but I can't reproduce the issue on Firefox 90 on Windows 10 (or Chrome, for that matter). This could mean that there are some issues in your personal CSS settings, or there might be an issue with a browser extension you've got installed. I would recommend checking if the same issue happens for your wiki account in other browsers as well; if it does, the issue is likely in your personal CSS file. If it doesn't, then the issue lies in either the browser extensions you've got installed, or perhaps it might be the use of Firefox on your operating system. However, I don't think I can help you with the information I've got from you right now. Joeytje50 (talk) 13:17, 31 July 2021 (UTC)
It's working again in the latest JWB. I probably did something silly locally. Thanks for investigating. Certes (talk) 13:31, 31 July 2021 (UTC)

Generate list - how switch to article's Talk pages?

Hi, Now that I'm on Linux Mint (instead of Windows) laptop, this is my first running of script AWB instead of Windows version. Here are my old notes of how to bring up Talk pages from Category list. Wondering how to do this with script AWB?

Following Work-Around notes
  • How to get article Talk:pages - This works for talk pages
  1. - Make list
  2. - Convert TO Talk pages
  3. - List filter Talk:B
  4. - Convert FROM talk pages

Please help. Not sure if this can be done. Thanks. JoeNMLC (talk) 14:35, 8 August 2021 (UTC)

ω Awaiting - JoeNMLC (talk) 17:02, 1 October 2021 (UTC)
@JoeNMLC What exactly are you trying to do? Can you provide an example? ― Qwerfjkltalk 19:31, 1 October 2021 (UTC)
Hi @Qwerfjkl: - As it recall, above is a "trick" on huge categories, to filter out only article titles that start with, for example letter "B". On JavaScript version, I see no option the "Convert to talk" or "List filter". Is there something on JWB "Skip" tab, "Regular Expression" to Skip if first title character is not "B"? Sorry if my attempt at explaining is not clear. JoeNMLC (talk) 20:22, 1 October 2021 (UTC)
You may be able to do this when generating your list. For example, if it's a Cirrus search, add prefix:B at the end. If not then sort the list (Setup tab, Sort button); select start to Azzz and delete; select C to end and delete. Certes (talk) 20:52, 1 October 2021 (UTC)

Hi @Certes and Qwerfjkl: - During this week, I build my own JWB help page to wrap my head around basic JWB navigation and processing.

Example of what I'm trying to accomplish, Category:Orphaned articles from February 2013 has over 2,000 articles. Need to filter "List of pages" to contain only letter "M" articles. At Wikipedia:AutoWikiBrowser/Regular expression#Simple search I did find wikicode to find article title begins with "Letter".

Simple search

This does not work, or need to find how.

  • Filter page list examples.
Find article pages, first character of title, is A
Regex: ^A
Find talk pages, first character of title, is B 
Regex: ^Talk:B

So for now, I'm confused about how to use/setup above so it does work.

  Question: - why is "Regular Expression" on both Editing tab and Skip tab? JoeNMLC (talk) 14:26, 2 October 2021 (UTC)

@JoeNMLC: You could try Setup → Generate → Wiki search. Use a Search term of incategory:"Orphaned articles from February 2013" prefix:B and select (main) namespace. The two "Regular Expression" checkboxes apply to other fields. In Editing, it indicates that you want to replace a regular expression rather than literal text: e.g. if you are replacing ",+" you want to replace one or more commas, rather than a commas and a plus. In Skip, it indicates that you want to skip pages matching a regular expression rather than literal text. Certes (talk) 20:34, 2 October 2021 (UTC)
Thanks @Certes: for your help. Above Search works correctly. Also I discovered that above can be repeated to get additional prefix, for example: B then C then D, so it appends to Page list. This works great for Article pages. Still have not figured out how to Generate for Talk pages, but will look at that later, no rush. Thanks again. JoeNMLC (talk) 18:36, 3 October 2021 (UTC)
@JoeNMLC Just use talk: e.g. prefix:"Talk:M" ― Qwerfjkltalk 18:41, 3 October 2021 (UTC)
@Qwerfjkl: - Yes, I tried both prefix:"Talk:M" and prefix:Talk:M and neither of these work. JoeNMLC (talk) 18:50, 3 October 2021 (UTC)
This only works if the search matches the talk page content (not its article) and you have the Talk namespace selected in the list to the right. Don't use quotes, or you'll limit the search to page titles containing quotes. If you need to search articles but edit their talk pages, you may need to create a list of articles, copy it to your favourite text editor, prefix each line with Talk: and paste it back. Certes (talk) 19:16, 3 October 2021 (UTC)
(edit conflict) @JoeNMLC Talk:B seems to work. The category will not contain talk pages. To convert the article list to talk pafges, You can run the regex \n -> \nTalk: which will almost do it (it won't quite work at the start and end). ― Qwerfjkltalk 19:20, 3 October 2021 (UTC)
Thanks @Certes: - Yes that copy/paste works just what I needed. In Notepad++ there is "Edit" → "Column Editor" → Text to insert → type in "Talk:" → OK. Then delete all old Pages to edit, and Paste in new list with Talk pages. Easy-peasy! Thanks. JoeNMLC (talk) 20:28, 3 October 2021 (UTC)

Is skipNotContains broken?

I'm having trouble getting it working.

For instance, with a list of:

  • WEY VV7
  • Wuling Dragon
  • Wuling Hongguang
  • Wuling Hongguang Mini EV
  • Xpeng G3
  • Xpeng P7

The last three are electric cars, whereas the first three are not. On a skipNotContains of 'kWh', the result should be:

  • Wuling Hongguang Mini EV
  • Xpeng G3
  • Xpeng P7


However, it's instead exactly the opposite, and the same as skipContains:

  • WEY VV7
  • Wuling Dragon
  • Wuling Hongguang

This is true of pre-parsed and non-pre-parsed operation.

What gives? --No coffee, please. (talk) 02:10, 19 September 2021 (UTC)

@User:No coffee, please. I'm sorry about that, it was a bug that somehow snuck in. A bugfix got submitted a short while ago, which I applied now, meaning it should work again now. Joeytje50 (talk) 14:20, 1 October 2021 (UTC)
Amazing, thank you so much Joeytje50 !!!! 👏👏👏👏👏 --No coffee, please. (talk) 14:24, 1 October 2021 (UTC)
Skip contains is still broken for me, but only in Chrome. Don't see it in Firefox. Could you please tell me if I need to reset cookies/cache/localStorage/something else in Chrome to ensure I'm running the latest version of JWB? —⁠andrybak (talk) 16:56, 19 November 2021 (UTC)

"Skip" tab question

Hi, Today I started my own subpage here with "Notes" for JWB to help me remember what keypress, and in what sequence. When I click on the Skip tab, nothing can be clicked on/filled in. What am I missing? JoeNMLC (talk) 18:33, 1 October 2021 (UTC)

@JoeNMLC First press the stop button. ― Qwerfjkltalk 19:30, 1 October 2021 (UTC)
Thanks @Qwerfjkl: - I could'of never figured that out on my own. I have updated "Skip" section of my help notes. JoeNMLC (talk) 19:59, 1 October 2021 (UTC)

Can we use on Commons?

Hi. Thanks for this. Very handy now that I'm on Linux.

Does it work on Commons? I'm not clear on how to install there. — kwami (talk) 02:23, 2 October 2021 (UTC)

@Kwami see the documentation:

Even if the wiki it's being used on already has some infrastructure for AWB, you need to install it for yourself. It is not recommended to install this script on a wiki-wide basis.


To install this script for yourself on any wiki, put the following code in your JavaScript file (typically this is Special:MyPage/common.js, but skin-specific JS files could also be used):

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');
 ― Qwerfjkltalk 07:15, 2 October 2021 (UTC)
Ah, I see. On Commons, it appears under 'Tools' rather than being accessed through your link. Solved! — kwami (talk) 05:24, 3 October 2021 (UTC)

Magic words?

Hi again.

I'm looking to incorporate the names of a batch of files into their categories. (They're all conveniently named that way.) Is it possible to do that with something like %%PAGENAME%%? That doesn't work, but is there a different syntax that will?

Thanks — kwami (talk) 18:15, 3 October 2021 (UTC)

@Kwamikagami: $x may do what you want. Certes (talk) 18:40, 3 October 2021 (UTC)
Perfect! Thanks a lot. There's 200+ files. — kwami (talk) 18:45, 3 October 2021 (UTC)

bug

Hi. Think I found a bug. If I want to make multiple changes ('more replace fields'), I can't put anything in the main replace field (or it will only perform that change). But if I don't have anything in the main field, then if I skip when 'no changes were made', I get the error message "No replacement rules were specified, with JWB set to automatically skip when no changes are made." So I'm making a bunch of null edits instead, and get periodically halted by the wiki for making too many changes too quickly. — kwami (talk) 18:22, 4 October 2021 (UTC)

I've noticed part of that: if I use only the "more" fields then I have "no replacement rules", and I have to add a dummy main (replace zzz by zzz). However, when I use the main replace field, either for real or as a dummy, the "more" fields also still work correctly. Certes (talk) 18:59, 4 October 2021 (UTC)
Hadn't thought to try that. That woulda saved me some time. — kwami (talk) 19:30, 4 October 2021 (UTC)

Hm. Working on Commons. Not sure if the two problems occur on the same wikis. I'd just assumed the behavior was the same, and so didn't use the main replace field on Spanish wikisource because that had caused problems elsewhere. But when I imported my wikisource .json file into Commons, the first of the 'more replace fields' was moved onto the main page, and that worked fine. — kwami (talk) 19:27, 4 October 2021 (UTC)

@Kwamikagami: I was not able to reproduce your main issue, where JWB ignores further changes if your main replace field is filled in. However, I was able to fix the other issue you were having, where the error message warning about infinitely skipping was given despite you having replacements defined in later fields.
To improve the script, I'd love to be able to debug the original issue you are having with the other replacement fields being ignored, so if you could share the settings I would need to copy to reproduce this, I'd be happy to investigate. Simply link me the JWB-settings.json subpage of your userpage on the wiki where this bug occurs, and tell me which settings profile I would need to copy. Also, please do let me know which browser you are using, as that may be relevant.
Of course, it may be that the solution I implemented to fix the secondary issue may have fixed your original issue. In that case, please do let me know as well. Joeytje50 (talk) 21:28, 11 July 2022 (UTC)

Problem at Commons

Hello!

When editing Commons file pages, the diffs show all mediainfo (i.e. structured data and captions) being removed. When you save however they are not removed, so no harm done. It should still be fixed though. I couldn't find anyone reporting it above.Jonteemil (talk) 23:29, 19 October 2021 (UTC)

Hey there, apologies for the delay. Hopefully this has not been bothering you too much in the past months. Could you please provide me with some more information on how to reproduce this issue? Also, I am not on the MediaWiki Commons checkpage, so that might complicate issues slightly on my side. I can implement a small workaround, but if possible I'd like to know a bit more about the issue before doing that. Joeytje50 (talk) 21:32, 11 July 2022 (UTC)

Text box width

Please can text boxes such as "Search term:" within Setup → Generate extend to fill the blank space to their right? I often use complex search terms, and currently can only see the first few words of the expression.

🗹 Wiki search _______________________
 Search term: |______________________| (lots of unused space here)

I think srsearch is inheriting a 200px width from somewhere. Adding width: 95%; to .JWBpopup seems to fix it, but I'm not sure whether it breaks anything else. Thanks, Certes (talk) 23:21, 26 October 2021 (UTC)

@Certes: Thanks for the suggestion. I've implemented your suggested changes to the script. If you ever have any other suggestions please do let me know. Joeytje50 (talk) 21:56, 11 July 2022 (UTC)
Thanks: that works, as long as I add class="fullwidth" to #srsearch. Certes (talk) 22:57, 11 July 2022 (UTC)
@Joeytje50, <input type="text" id="srsearch" name="srsearch" placeholder="Recommended: insource:/example/ or intitle:/example/"> is still the only input field that does not have class="fullwidth" added to it. And the field is the one that I use the most, with most text added to it. It's so small that I only see half of the placeholder code in it. Ponor (talk) 19:31, 8 November 2022 (UTC)
Yes, first thing I do when I open JWB is go into Developer Tools and expand that field. Certes (talk) 19:57, 8 November 2022 (UTC)
@Certes and Ponor: Apologies, it seems like I might have screwed something up in my earlier change. I've tested it now, and my latest change should have fixed this now. Apologies for the delay to such a relatively simple issue. Joeytje50 (talk) 16:18, 29 January 2024 (

Feature request: show categories of the edited page in the preview

In regular wikitext editor, preview shows categories under "Parser profiling data". It would have been nice, especially for mass categorization edits, to be able to see the resulting categories of a page in the preview created by JWB. —⁠andrybak (talk) 14:02, 19 November 2021 (UTC)

@Andrybak: Thanks for the suggestion! I've implemented this into the script now; at the bottom of every page there will be a box listing the categories, in the same way normal page viewing shows it. If there are no categories on the page, the box is hidden. If you have any more suggestions, please let me know. Joeytje50 (talk) 22:48, 11 July 2022 (UTC)
Joeytje50, great to hear. Thank you for maintaining and improving JWB. —⁠andrybak (talk) 22:50, 11 July 2022 (UTC)
Joeytje50, I tried it out. Somewhere along the line, the ":Category:" prefix got lost. For example, when editing Template:FLpages in JWB, I see:

Categories: Wikipedia_featured_content_templates | Wikipedia_Today's_featured_list

(except the links are blue, not red) instead of

Categories: Wikipedia_featured_content_templates | Wikipedia_Today's_featured_list

or

Categories: Wikipedia featured content templates | Wikipedia Today's featured list

seeing the category names is helpful, but making them proper links would be even better :-) —⁠andrybak (talk) 19:32, 15 July 2022 (UTC)

Joeytje50, please change line 546 from:

				$ul.append('<li><a href="/wiki/' + encodeURIComponent(cg) + '" title="' + cg + '"' + redlink + '>' + cg + '</a></li>');

to:

				$ul.append('<li><a href="/wiki/Category:' + encodeURIComponent(cg) + '" title="' + cg + '"' + redlink + '>' + cg + '</a></li>');

to fix the bug reported above. —⁠andrybak (talk) 21:31, 11 August 2022 (UTC)

Dear interface administrators, Joey appears to not be currently active. Please apply the suggested bugfix above. —⁠andrybak (talk) 09:12, 20 August 2022 (UTC)

@Andrybak this user has edited as recently as a month ago, have you tried emailing them about their own personal user script you want changed? — xaosflux Talk 09:51, 20 August 2022 (UTC)
  Done Izno (talk) 18:18, 22 August 2022 (UTC)

Translations issue

I'm having some problems with the translated version of this tool We (well, it was @Valepert who did it) imported JWB in itwiki and Valepert has translated every string of the tool, but every time I start it I don't get the translated labels, but a ⧼label-name⧽ placeholder (e.g. ⧼tab-setup⧽ or ⧼editbutton-preview⧽). Through console (both on Vivaldi and Firefox on Windows 11) I've seen I get this error

    Uncaught TypeError: Cannot read properties of undefined (reading 'querySelectorAll')
    at Object.init (load.php?lang=it&modules=ext.discussionTools.init|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=monobook&version=17cpk:16)
    at mw.dt.init (load.php?lang=it&modules=ext.discussionTools.init|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=monobook&version=17cpk:2)
    at Object.add (<anonymous>:592:696)
    at dt.init.js (load.php?lang=it&modules=ext.discussionTools.init|jquery%2Coojs-ui-core%2Coojs-ui-widgets&skin=monobook&version=17cpk:2)
    at runScript (load.php?lang=it&modules=startup&only=scripts&raw=1&skin=monobook:12)
    at Array.<anonymous> (load.php?lang=it&modules=startup&only=scripts&raw=1&skin=monobook:13)
    at flushCssBuffer (load.php?lang=it&modules=startup&only=scripts&raw=1&skin=monobook:4)

I'm not sure this can help, but without knowing what I'm clicking the tool is nearly unusable. Mannivu (talk) 17:20, 20 January 2022 (UTC)

@Mannivu: Apologies for the late reply. I tried checking what the tool looks like on itwiki, and it looks like the translated labels show up correctly now. If at any point in the future, the same occurs again, you can add ?uselang=en at the end of the URL as a temporary measure. However, I expect this issue might not have been caused by JWB itself, but by some other issues with JavaScript on the wiki, either in your personal JS, or something that used to be in the wiki's site-wide JS. The error you pasted does not seem to be caused by JWB itself.
If this issue still occurs please do let me know, then I can try to see if I can reproduce the issue, in order to fix it. Joeytje50 (talk) 22:53, 11 July 2022 (UTC)

Genfixes

Forgive me if this a newbie question, but is there a way to run genfixes on JWB? I'm on Linux, so setting up regular AWB is a bit much for at the moment. Rusalkii (talk) 01:15, 22 February 2022 (UTC)

@Rusalkii: Ticking "Enable RegEx Typo Fixing" enables many fixes, but won't do things like moving the short description to the top. I run AWB on Linux (Ubuntu 16.04 with Wine 5.0.3 and riched20 installed via winetricks). It's usable but not perfect, and I usually prefer JWB unless I really need an AWB-only feature. Certes (talk) 13:17, 22 February 2022 (UTC)

JWB in Santali Wikipedia

Hi, I was testing this tool in Santali Wikipedia. But this tool is not working as expected, this is the typo list . I have used Regex of AutoWikiBrowser and it fixed this page AWB revision. But the same page was not fixed using JWB. Can anyone guide me where the issue lies. Rocky 734 (talk) 03:50, 7 May 2022 (UTC)

@Rocky 734: I tested it out and here's my conclusion: The problem is that JWB is written in Javascript while that of AWB is C# and these two languages have their own way of interpreting regexes. Most RETF regexes have \b which match word boundaries (a word character followed by a non-word or vice versa), but to JS, "word characters" simply means [a-zA-Z0-9_]. C# understands it much better; all characters included in these Unicode tables are considered "word characters". See the differences on regexr101.com: JS/C#. NguoiDungKhongDinhDanh 09:21, 7 May 2022 (UTC)
Thanks alot @NguoiDungKhongDinhDanh, for providing me all the support materials. Now, i understood why it was not working. I think instead of creating a word boundary i should try keep the typo simple, maybe a single word. So that it will work in both case. Rocky 734 (talk) 06:18, 8 May 2022 (UTC)

JWB on demand

I didn't want to have JWB permanently preloaded (on common. or skin.js), so I put it on MusikAnimal/scriptManager.js, but still had to remember the address to open that page. I never could, so I'd always have to come back here. But where was here?? There I was back in my common.js digging up the address I had jotted down there for scriptManager. Don't laugh, ikr!
I know I could simply bookmark it on my browser, or, if I wanted to get fancier still, create a portlet link for it, but that was still 2 clicks. So I tested my mwjs on putting JWB under the More menu to open that page, and then load JWB.js, but failed. Miserably. Perhaps you could easily spot my crude mistake, Joey. Cheers. Guarapiranga  01:08, 16 June 2022 (UTC)

I don't get it. User:Joeytje50/JWB.js/load.js is already a wrapper that loads the core script only if you're on Project:AutoWikiBrowser/Script. Nardog (talk) 01:33, 16 June 2022 (UTC)
Are you saying it's not taking up resources in the browser, unless the user visits Project:AutoWikiBrowser/Script, Nardog? If that's the case, then all I need now is the portlet link to that page somewhere (so I don't need to remember it—I never do). Guarapiranga  03:14, 17 June 2022 (UTC)
All User:Joeytje50/JWB.js/load.js does is add a portlet link to Project:AutoWikiBrowser/Script in #p-tb and load the script on that page. Nardog (talk) 11:13, 17 June 2022 (UTC)
Aha, right! There it is. Thanks, Nardog.— Guarapiranga  00:07, 18 June 2022 (UTC)

Can JWB be used to create (redirect) pages?

I couldn't get it to do that. Guarapiranga  04:28, 21 June 2022 (UTC)

@Guarapiranga: Yes, just like any other kind of pages. At the Skip tab, choose the neither radio button. NguoiDungKhongDinhDanh 05:11, 21 June 2022 (UTC)
Aha, right! Thanks. Guarapiranga  07:44, 21 June 2022 (UTC)
I see you've made several thousand redirects, but a reminder to others that bulk semi-automated article creation requires community approval per WP:MASSCREATION. Reywas92Talk 13:11, 21 June 2022 (UTC)
Thanks for the heads up, Reywas92. Duly noted, however WP:MASSCREATION excplicitly applies to all "content pages", broadly meaning pages designed to be viewed by readers through the mainspace, including articles, most visible categories, files hosted on Wikipedia, mainspace editnotices, and portals. The pages I mass created, as you noted, are redirects. Guarapiranga  22:14, 21 June 2022 (UTC)
It's also explicitly noted in the original discussion that redirects are an exception. ― Qwerfjkltalk 06:13, 22 June 2022 (UTC)

Prepending and appending

I know that AWB has a mode to prepend or append text to each article in a list. Perhaps I am simply ignorant, but I don't see any way for JWB to do this. I can add as many replace fields as I want, but I can't just tell it to put some particular block of text at the beginning (or end) of each page I have in the list.

If this functionality doesn't exist (and I am not just missing something), it may be possible for me to write it. Let me know! jp×g 05:59, 23 July 2022 (UTC)

@JPxG, it doesn't exist in JWB, though you can use RegEx instead, e.g. ^Prepended text, and $Appended text. ― Qwerfjkltalk 06:06, 23 July 2022 (UTC)
Hilariously enough, I had found this out and tested it out successfully about ten seconds prior to getting the notification here... I think it might be smart to add a little note about this to the interface somewhere (it works perfectly on every page I tested it on). jp×g 06:08, 23 July 2022 (UTC)
Yes, it's a common use case. I've been replacing ^ by {{short description|}}\n (inserting a pithy phrase manually). $ is less obvious – inexperienced users might expect it to match after the first or every line. Certes (talk) 12:29, 23 July 2022 (UTC)

Bugs when using in Russian Wikipedia

Thank you for your work with the script. I’m encountering two separate problems while trying to run it in Russian Wikipedia recently:

  1. On my own account, if you run the script from the console, its CSS gets loaded, but JWB never starts unless you explicitly type JWB.init() yourself.
  2. On my bot account, it fails with this error:
    Uncaught TypeError: can't access property "ru", JWB.messages is undefined
        <anonymous> https://en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/i18n-ru.js&action=raw&ctype=text/javascript&_=1662991601155:10
    index.php:10:1
    

(I don’t use it frequently, but this definitely wasn’t a problem before.)

Also, just a suggestion: the script should probably use wgUserLanguage as opposed to wgContentLanguage when determining which language to load. stjn 14:09, 12 September 2022 (UTC)

how to configure jwb for check wikipedia project?

if i click error 1 page, it does not contain categories (bcoz it is not regular wp page). how do i setup/configure to check wikipedia project? -jindam, vani (talk) 10:08, 21 September 2022 (UTC)

@Jindam vani, What are you trying to do? You can get a list of pages to edit by clicking on List for bots, and pasting that into JWB. — Qwerfjkltalk 17:41, 21 September 2022 (UTC)
@Qwerfjkl i was hoping this will fix issues similar to wpcleaner, apparently i did not read jwb page...-jindam, vani (talk) 17:48, 21 September 2022 (UTC)

More replace fields

Hi, I am just testing this tool. I clicked on More replace fields button, and it throws up a disabled window. I cannot use it. Where is the error? Bináris (talk) 12:47, 10 December 2022 (UTC)

@Bináris, did you press 'stop' first? — Qwerfjkltalk 12:49, 10 December 2022 (UTC)
No, I did not. This was the error. Thank you! Bináris (talk) 21:07, 12 December 2022 (UTC)

Preparsing

Hi Joey,

How does preparse work? If I select the check box, it simply skips all articles in the list.

And thanks for creating this BTW. I can't figure out how to get AWB to work on my current laptop, so JWB is a lifesaver.

Thanks — kwami (talk) 00:55, 23 January 2023 (UTC)

@Kwamikagami, what's your skip configuration? — Qwerfjkltalk 21:02, 25 January 2023 (UTC)
Ah, I see. If I remove the check on 'no changes made', it still skips all of the articles, but then restores the hits when it's done. I'm used to them collecting at the top of the list.
Also, how do I load saved settings? I'd guessed it was 'refresh', but that doesn't seem to do anything.
Thanks! — kwami (talk) 22:42, 25 January 2023 (UTC)
@Kwamikagami, 'load'? — Qwerfjkltalk 07:03, 26 January 2023 (UTC)
It doesn't look like you have any saved settings. — Qwerfjkltalk 07:06, 26 January 2023 (UTC)
When I save my settings, close JWB, and later want to use them again, how do I restore them?
I don't have any saved settings on WP-en, but do on other wikis. — kwami (talk) 07:07, 26 January 2023 (UTC)
@Kwamikagami, under settings, in the dropdown after Load: — Qwerfjkltalk 07:31, 26 January 2023 (UTC)
Yes, there's a list, but choosing one doesn't cause it to load.
It looks like I need to choose it and then hit a 'load' button, but I don't see one. I thought maybe it was 'refresh', but that doesn't seem to be it. — kwami (talk) 07:34, 26 January 2023 (UTC)
@Kwamikagami, just choose it. It should load as soon as you choose an option from the dropdown. — Qwerfjkltalk 17:01, 26 January 2023 (UTC)
Thanks. I'll keep playing with it to see what I'm doing wrong. — kwami (talk) 17:29, 26 January 2023 (UTC)

Deletion: please add option to delete talk page also

Hi, when deleting a page manually, there is a tick-box for deletion of the talk page. Please add this functionality to the Delete function in AWB JWB. – Fayenatic London 21:04, 29 September 2023 (UTC)

@Fayenatic london: Thanks for the suggestion! I finally got some time to implement this, so this is now in JWB. There is now a checkbox that allows you to automatically (un)delete a talk page along with its main page. If you have any more requests, please let me know! Joeytje50 (talk) 00:47, 28 December 2023 (UTC)
Thank you Joey – I mostly use JWB for editing rather than deletion, but will gladly keep this Christmas gift! – Fayenatic London 09:25, 28 December 2023 (UTC)

Contributing: PRs on GitHub or edit requests on Wikipedia?

I've contributed code changes to JWB in the past via this talk page. However, section User:Joeytje50/JWB#Contributing to JWB says

If you would like to contribute code to JWB, please see the GitHub repository. You can create a pull request there to submit code or bug fixes to the script.

URL https://github.com/Joeytje50/JWB/ redirects to https://github.com/wikimedia-gadgets/JWB. There, last commit is 89f710e (Fix alignment issue causing checkbox to overlap summary, 2021-10-01). It seems that since at least January 2022, the repository isn't monitored, because pull request #15 hasn't been addressed since it was opened.

Should section Contributing to JWB be updated? Is the GitHub repository still relevant?

I'm asking because I've opened a GitHub pull request before realizing that the GitHub repo isn't up-to-date with code here on enwiki (Special:Diff/1047570522/1105989678). —⁠andrybak (talk) 20:46, 10 October 2023 (UTC)

Oh, another thing about the GitHub repo URL redirecting. Commits like 17c4b52 (Sync changes to 4.2.2, 2021-04-05) make it seem as though the development was happening on-wiki and then synced by Joeytje50 to GitHub. GitHub user Joeytje50 isn't listed in the GitHub organization "wikimedia-gadgets".
All of this combined make it seem as though Joeytje50 no longer maintains the GitHub repository. Pinging Chlod, Ed6767, SD0001, and Novem Linguae – perhaps somebody from people listed in the GitHub organization would know the status of the repository? —⁠andrybak (talk) 20:57, 10 October 2023 (UTC)
@Andrybak I'd have to check but I think Joey has access to the repository under the organisation? If not I can change this. If you need your PR reviewing feel free to assign it to me and I can take a look! But I would be unable to sync it to the Wiki. ✨ Ed talk! ✨ 21:06, 10 October 2023 (UTC)
Ed6767, thank you for looking into this. My concern with review and merge of the PR is that GitHub's repository needs to be synced first. —⁠andrybak (talk) 21:10, 10 October 2023 (UTC)
If you end up +2ing the PR, you can put in an {{IAER}} and an interface admin can action it for you. –Novem Linguae (talk) 21:24, 10 October 2023 (UTC)
Confirmed this part: make it seem as though the development was happening on-wiki and then synced by Joeytje50 to GitHub – via Joeytje50's talk page. Quote from Special:Diff/1007579977: Right now my workflow is to make edits on the wiki first (in a dev version of JWB on a separate userpage) and then copying them over to github after that. —⁠andrybak (talk) 21:08, 10 October 2023 (UTC)
As frequently happens to wiki tech, it looks like the maintainer Joeytje50 went inactive, hasn't edited in 3 months. Looks like onwiki is about 17 commits ahead of the repo. I'd be in favor of adding the wiki commits to the repo in a big commit to get things up to date at the repo, then we could continue with the current workflow of creating issues and PRs at the repo. Before doing that, I'd like to try a user talk message on Joey's talk page. I'd also be in favor of updating the github.com/joey links to github.com/wikimedia-gadgets. I think a GitHub repo move was done in the past and it would be fine to update these links. I have enough access to update all this stuff (interface admin, member of Wikimedia Gadgets), but again, let's try checking with Joey first. I'll go leave a user talk message. –Novem Linguae (talk) 21:12, 10 October 2023 (UTC)
P.S. Joey is a member of Wikimedia Gadgets. Looks like most of the members are set to private though so only other members can see that they have access on the list of members. There's 4 public members and 11 private members. –Novem Linguae (talk) 21:16, 10 October 2023 (UTC)
Novem Linguae, sounds like a plan. Thank you. —⁠andrybak (talk) 21:17, 10 October 2023 (UTC)
My apologies for the inactivity; I occasionally check up on my talk page(s) to update on feature requests, and usually I try to sync the changes I made back up to the github. It looks like I seem to have forgotten to commit my last changes to Github as well.
Regarding the workflow: I think that if you want to contribute code, the best way to do that is to make a PR to the Github version, and request for the commit to be applied to the enwp-hosted version as well. I will occasionally make some time to work on new stuff or on bugfixes, but I can't guarantee being available at all time, meaning requests may have to wait for a couple of months. If anyone still has questions about this, I'll try keeping an eye on this page for the upcoming while to make sure I can respond to those questions. Joeytje50 (talk) 14:26, 21 December 2023 (UTC)
Joeytje50 regarding It looks like I seem to have forgotten to commit my last changes to Github as well. – please do update the GitHub version (don't forget to push ;-). I'll will take care of merge conflicts in my pull request, if any show up.
but I can't guarantee being available at all time – no problem at all, take your time, don't burn yourself out, etc. —⁠andrybak (talk) 08:47, 22 December 2023 (UTC)
@Abdrybak: The github repo is now up-to-date with the edits made to the enwp version, so any future edits should be easy enough to copy/paste onto enwp to 'deploy' them, so to say. I might be working on some features at some point, but until then it'd be awesome if other people want to submit PRs to contribute to the tool. Joeytje50 (talk) 01:24, 28 December 2023 (UTC)

Adding categories?

Is there way to use JWB to add a category to pages? RoySmith (talk) 23:49, 30 October 2023 (UTC)

@RoySmith: Yes: just change $ to \n[[Category:Foo]] with regexp on and flags set to i. If you want the category to appear above certain others then it's slightly more complicated. Replacing (\n *\[\[ *Category:Insert above me|$) by \n[[Category:Foo]]$1 (without the g flag) may work. Certes (talk) 10:45, 31 October 2023 (UTC)
Thanks, sounds easy enough. RoySmith (talk) 13:23, 31 October 2023 (UTC)
Are categories always at the bottom of the page? It might get a bit messy otherwise. — Qwerfjkltalk 21:29, 31 October 2023 (UTC)
Good point. MOS:ORDER says {{Improve categories}}, {{Uncategorized}} (which you'd presumably remove) and stub templates go after categories. So it may be better to replace something like
  • (\n *\{\{ *[Ii]mprove categories|\n *\{\{ *[^}|]*?\bstub *\}\}|$)
(no flags, especially not g) by
  • \n[[Category:Foo]]$1
and remove {{Uncategorized}} in a separate regexp. Certes (talk) 22:58, 31 October 2023 (UTC)
@Certes, what about something like
([\s\S]+\[\[ ?[Cc]ategory:.+?\]\]|$)
with $1\n[[Category:foo]]
If I've done it right, matching the last category on the page and just inserting it afterwards. — Qwerfjkltalk 09:28, 1 November 2023 (UTC)
Yes: I've not tested it but that looks good. $1 will be huge but that probably doesn't matter here. \K is an alternative, if supported. The only problem I can see is if there are no existing categories but a stub template which we want to stay at the bottom after our new category. Certes (talk) 09:38, 1 November 2023 (UTC)
@Certes, true, but very few pages are uncategorised so seems like a minor edge case to me. Could use positive lookbehind to avoid actually matching the whole page. — Qwerfjkltalk 15:11, 1 November 2023 (UTC)
...or just leave the |$ out. Certes (talk) 17:18, 1 November 2023 (UTC)
What would that do? That would just mean it won't match anything if there are no categories, so it would fail. — Qwerfjkltalk 17:46, 1 November 2023 (UTC)
Yes, in the minor edge case where we need to edit manually. Certes (talk) 18:56, 1 November 2023 (UTC)