Wikipedia talk:WikiProject User scripts/Scripts/WikiBreak Enforcer/Archive 1
![]() | This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 |
Ways around the script
There are actually two ways around the script, but I'm not going to tell you :) — Nathan (talk) 22:16, 3 June 2006 (UTC)
- Don't click here :-). AmiDaniel (talk) 22:38, 3 June 2006 (UTC)
- Damn you, I wasn't about to tell! ;) — Nathan (talk) 22:23, 4 June 2006 (UTC)
- This is such a wicked idea. I can finally get some work done out in RL – and some sleep! --Riana @ 14:41, 13 August 2006 (UTC)
- Surely it's obvious to anyone that knows how to change the settings in an internet browser? Dave 23:17, 12 September 2006 (UTC)
- There's also another easy way to bypass, but which, AFAIK, hasn't been mentioned here. I'll keep quiet; however, that bypass can be blocked by protecting your .js page. ;-) --Deathphoenix ʕ 13:15, 15 September 2006 (UTC)
- Yup, I see what you mean. Dave 23:25, 24 October 2006 (UTC)
- Yeah good job to all! — Seadog 03:21, 6 December 2006 (UTC)
- Yup, I see what you mean. Dave 23:25, 24 October 2006 (UTC)
- There's also another easy way to bypass, but which, AFAIK, hasn't been mentioned here. I'll keep quiet; however, that bypass can be blocked by protecting your .js page. ;-) --Deathphoenix ʕ 13:15, 15 September 2006 (UTC)
Thanks for writing this, folks - a useful tool indeed. Now, here's a challenge for those well-versed in coding (as I am not): can WikiBreak Enforcer, or a variant, be designed to lock you out during certain hours, on an ongoing basis? The idea being, one could set it to lock up between midnight and 8 AM (time adjustable) to ensure at least a bit of sleep? --Ckatzchatspy 18:25, 9 January 2007 (UTC)
- Oh yeah, that would be very helpful! (Of course, what I REALLY need is a program that blocks any access whatsoever to a number of favorite websites between those hours... But that's definitely beyond the scope of any Wikipedia script, lol!) --Icarus (Hi!) 23:00, 9 January 2007 (UTC)
- Buy two computers and use one for serious work and one for other stuff. Have separate areas and times for doing different stuff. That can help compartmentalise addictive areas of your life. My solution is to continually switch between different things, and try not to get too involved in any one thing. Sometimes, though, this leads to being unable to commit to any one thing. Carcharoth 11:40, 12 January 2007 (UTC)
My mind was wicked enough to use a text browser and edited my .js page, I wish I have never thought about it. Now the script is useless!--Dyaa (talk) 16:05, 3 March 2010 (UTC)
Possibile scenario
At risk of ignoring WP:BEANS, couldn't someone put this in someone elses javascript page? It could be quite disruptive for an inexperienced user, obviously the solution would be to log out and edit the monobook.js page, but many people wouldn't realise. James086Talk 12:13, 14 January 2007 (UTC)
- Is it actually possible for one user to edit another user's monobook.js? That seems like a pretty big security hole... Mike1024 (t/c) 19:40, 14 January 2007 (UTC)
- I don't know if there are any ways a person could hack into another's monobook.js, but it's not possible to do it normally. Only a logged in user can access their own monobook.js (maybe admins and/or sysops too; I dont know). You can only view the source, as if it's a protected page, if you're not logged in or logged in as a different user. The only possible misuse I can think of would be for an anonymous IP to use it, thus blocking any other users at that IP. --Icarus (Hi!) 22:15, 14 January 2007 (UTC)
- Oh ok, I hadn't tried editing anyone elses js page, I guess it would be a pretty big security hole if you could. James086Talk 02:54, 16 January 2007 (UTC)
- Anonymous IPs can't edit any monobook.js, even their own. So we don't have to worry about that... :) Registered users can't edit their IP address's corresponding one either --WikiSlasher 05:48, 16 February 2007 (UTC)
- Anyone can edit their own monobook.js. Also, admins can edit anyone's monobook.js. I know because an admin once edited my monobook.js to remove part of one of my scripts that made it display on CAT:CSD, thus driving all the admins crazy. :) I got the script working after a while, though. Pyrospirit Flames Fire 15:13, 5 March 2007 (UTC)
A guess
Disabled your browser Java script and then try? Your wikibreak can be ended. Right? -- SAndTLets Talk 20:06, 16 March 2007 (UTC)
- Oh for pete's sake, of course that's the answer. I'm going to be bold and remove the "you can bypass this" part, per WP:BEANS. It's much more likely to help people out. If someone wants to revert, fine, go ahead, but realize you're only doing a disservice to the page. Part Deux 20:30, 26 April 2007 (UTC)
How about...
...putting Special:Userlogout in your hosts file? Melsaran (talk) 19:43, 27 September 2007 (UTC)
Dangerous script
This seems to be a two-edged sword more then anything else. I would like that it be deleted, to prevent people from using it dangerously. Laleena 12:30, 30 September 2007 (UTC)
- I don't understand - people can only apply it to themselves, and if they mess up (e.g. enter the wrong date), they can bypass the script easily anyway, as discussed above. Furthermore, users can still access wikipedia and even edit as anon. What's so dangerous about it? Mike1024 (t/c) 13:50, 30 September 2007 (UTC)
Is this one of the reasons there is a notice on .css and .js pages that says "Code that you insert on this page could contain malicious content capable of compromising your account. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. The code will be executed when previewing this page under some skins, including Monobook"? Keyboard mouse (talk) 23:43, 7 May 2010 (UTC)
Instructions
Dealing with the possible risk, I just wanted to affirm that all I need to change is this:
var year = 2007; //YYYY var month = 02; //MM var day = 25; //DD var hour = 20; //HH var minute = 52; //MM var second = 30; //SS
J-ſtanTalkContribs 03:07, 20 October 2007 (UTC)
- I think I got it. See you soon! J-ſtanTalkContribs 03:11, 20 October 2007 (UTC)
- It's not working. See? J-ſtanTalkContribs 03:13, 20 October 2007 (UTC)
- Check your computer clock, and that javascript is enabled in your browser. If that doesn't work, replace function EnforceWikiBreak with this test version:
function EnforceWikiBreak() {
alert ("EnforceWikiBreak running...");
var currentdate = new Date();
var enforced_break_end = new Date(year,changemonth(),day,hour,minute,second);
alert ("End date: " + enforced_break_end.toLocaleString() + " Now: " + currentdate.toLocaleString() );
if (currentdate > enforced_break_end) {
alert ("Current date is after break end date");
} else {
alert ("Current date before break end date");
}
alert ("EnforceWikiBreak done.");
}
- And report back what messages you get, then we can maybe help you more? Mike1024 (t/c) 09:59, 20 October 2007 (UTC)
- Ok, got it working. I just needed to clear the browser cache. Now I switched off javascript to come back for a while, edited it out of my monobook.js page, cleared the cache, switched javascript back on, and it logged me out. It isn't in my js page, but it is still active. I wouldn't mind, but I have twinkle and AVT, and I want to use them. J-ſtanTalkContribs 16:23, 22 October 2007 (UTC)
- Have you tried reloading a page via: Mozilla/Safari/Konqueror: hold down Shift while clicking Reload (or press Ctrl-Shift-R), IE: press Ctrl-F5, Opera: press F5 ? That should reload your monobook.js - without the wikibreak enforcer loaded. Mike1024 (t/c) 18:25, 22 October 2007 (UTC)
- I tried it with javascript disabled, but I changed by computer's date to the 26th, when I planned to come back. So I'll be 4 days ahead until friday, but I'm all set. J-ſtanTalkContribs 18:33, 22 October 2007 (UTC)
- Have you tried reloading a page via: Mozilla/Safari/Konqueror: hold down Shift while clicking Reload (or press Ctrl-Shift-R), IE: press Ctrl-F5, Opera: press F5 ? That should reload your monobook.js - without the wikibreak enforcer loaded. Mike1024 (t/c) 18:25, 22 October 2007 (UTC)
- Ok, got it working. I just needed to clear the browser cache. Now I switched off javascript to come back for a while, edited it out of my monobook.js page, cleared the cache, switched javascript back on, and it logged me out. It isn't in my js page, but it is still active. I wouldn't mind, but I have twinkle and AVT, and I want to use them. J-ſtanTalkContribs 16:23, 22 October 2007 (UTC)
- And report back what messages you get, then we can maybe help you more? Mike1024 (t/c) 09:59, 20 October 2007 (UTC)
way to prevent clock change from working
It could, if being run from firefox, check the timestamp in document.styleSheets[2].cssRules[2].href (or, iterate through the stylesheet collection - the one that sets text justification and link underlining is served with a timestamp in the URL) —Random832 20:38, 25 October 2007 (UTC)
changemonth() function
What exactly is changemonth()
necessary? Leading zeros are not required in a Date constructor, so month - 1
should work fine. - SigmaEpsilon → ΣΕ 23:02, 26 December 2007 (UTC)
Script update
The current code is a little messy. For example:
if(month==01) return 00;
if(month==02) return 01;
if(month==03) return 02;
if(month==04) return 03;
if(month==05) return 04;
if(month==06) return 05;
if(month==07) return 06;
if(month==08) return 07;
if(month==09) return 08;
if(month==10) return 09;
if(month==11) return 10;
if(month==12) return 11;
return 00;
This makes no sense, since in JavaScript, 04 is an integer and will be equal to 4 (same for other numbers). My suggested code:
(code removed because of some bugs; here is the updated version)
--grawity talk / PGP 19:20, 4 February 2008 (UTC)
- That looks pretty reasonable to me. The person who put in all that "if(month==01) return 00;" commented that "you can't use month-1 because it removes the '0' from the front" - though you'd think the number would be an integer, i.e. that wouldn't matter. Assuming you've tested your edits and they don't break anything, go ahead and edit them into the page with the script on! Mike1024 (t/c) 08:31, 6 February 2008 (UTC)
- I have fully tested it (except the redirection) with my monobook.js (also found that leading 0s cause number to be interpreted as octal), but can't update the page because "This page is currently protected, and can be edited only by administrators."
- Admins: The script
will beis available on my website, please update the page or give me rights so I can update it myself. --grawity talk / PGP 18:19, 6 February 2008 (UTC)
Edit request
- {{editprotected}}
The version I linked to has too much unnecessary comments, it should be changed to this version. And please remove the /* </nowiki></pre> */ line from the end - it doesn't do anything anyway. --grawity talk / PGP 19:30, 8 February 2008 (UTC)
- Code tidied. Gimmetrow 02:33, 16 February 2008 (UTC)
Other option to block yourself on one computer
Windows XP solution Be logged in as a privileged user. Open a DOS command window, type: notepad C:\WINDOWS\system32\drivers\etc\hosts Put the following line in hosts: 127.0.0.1 www.en.wikipedia.org File > Save. Now try to open http://www.en.wikipedia.org with any web browser on the PC. Remove the line you added from hosts to restore access to the www.en.wikipedia.org web site Note: to add other sites, continue to add another number: 127.0.0.1, 127.0.0.2, 127.0.0.3, etc... More information on this site. |
Firefox
Firefox add-on BlockSite, which is available at https://addons.mozilla.org/en-US/firefox/addon/3145
Inclusionist (talk) 07:35, 24 April 2008 (UTC)
- Note, our host name does not have a www in it... — xaosflux Talk 01:37, 19 May 2008 (UTC)
- Or you could just do it the CCPS way; add http://en.wikipedia.org to the web filter. PCHS-NJROTC (Messages) 22:31, 23 February 2010 (UTC)
A better solution?
Is there any way to prohibit your browser from sending HTTP requests using the “POST” method to 208.80.152.2 (or whatever en.wikipedia.org's IP address is)? Ideally this would be something that can be implemented in the computer's operating-system firewall. 69.140.152.55 (talk) 23:57, 24 May 2008 (UTC)
- It is impossible to block POST on the firewall level. HTTP requests are inside the data packets, and firewalls only check the outside stuff - IP addresses, ports, protocol types (TCP/UDP/ICMP/WTF). --grawity 12:01, 25 May 2008 (UTC)
- Ah, that makes sense. But I thought that most firewalls nowadays do "deep" packet inspection? 69.140.152.55 (talk) 15:31, 21 June 2008 (UTC)
- Well, I have KIS 7 (∞-day trial), and it doesn't. Besides, how many Wikipedia users have firewalls AND know how to configure them? Also, this script only prevents user from logging in - [s]he can still edit anonymously. Blocking POSTs would prevent from editing too. --grawity 17:58, 21 June 2008 (UTC)
Can someone add this for me?
Hi, I can't add this. Can someone add it down as an indef please?
BG7even 15:52, 26 June 2008 (UTC)
- Please don't try to make work for other people. If you want to log off, log off. If you want to come back later, come back later. "Enforcing" your retirement accomplishes nothing you can't already do. Friday (talk) 15:57, 26 June 2008 (UTC)
- Well, a) after spending 5 minutes of attempting to copy and paste the code I couldnt, and b) that doesn't work. I tried to leave and Wikibreak before - result - I spend 50€ in a week. BG7even 15:59, 26 June 2008 (UTC)
- Done, but only for 4 days. Take a break and see how you feel then. Ryan Postlethwaite 16:06, 26 June 2008 (UTC)
- Lolz it dunt work. BG7even 16:08, 26 June 2008 (UTC)
- Purge your cache (ctl and F5). Ryan Postlethwaite 16:09, 26 June 2008 (UTC)
- lol but i changed it. BG7even 16:10, 26 June 2008 (UTC)
- Well purge your cache then, but it will be tough to regain access to your account ever again. Ryan Postlethwaite 16:13, 26 June 2008 (UTC)
- lol but i changed it. BG7even 16:10, 26 June 2008 (UTC)
- Purge your cache (ctl and F5). Ryan Postlethwaite 16:09, 26 June 2008 (UTC)
- Lolz it dunt work. BG7even 16:08, 26 June 2008 (UTC)
- Done, but only for 4 days. Take a break and see how you feel then. Ryan Postlethwaite 16:06, 26 June 2008 (UTC)
- Well, a) after spending 5 minutes of attempting to copy and paste the code I couldnt, and b) that doesn't work. I tried to leave and Wikibreak before - result - I spend 50€ in a week. BG7even 15:59, 26 June 2008 (UTC)
question
I am just wondering if it is possible to enforce a wikibreak during certain hours of the day everyday???? DockuHi
Other Wiki Projects
Will this work on wiki projects like Wikiversity? or are ther special instructions? —Preceding unsigned comment added by 65.185.0.64 (talk) 03:18, 21 November 2008 (UTC)
- This script works on every mediawiki-based project. Regards, mabdul 09:35, 18 April 2012 (UTC)
Can someone...
Can someone write a script like this, but which logs me out when I load at a page between (say) 2 a.m. and 10 a.m. of any day, regardless of the date? -- Army1987 – Deeds, not words. 16:55, 13 December 2008 (UTC)
Did not work for me
I tried the wikibreak script in google chrome and in firefox, reloaded the page several times, removed all browser cache, logged out and logged back in several times, and nothing happened. I'm now going for the manual break, but I just wanted to say here that the explanation with the wikibreak script is not foolproof. --EdgeNavidad (talk) 13:02, 1 September 2009 (UTC)
- Are you participating in the usability beta, or have you otherwise changed your appearance settings? You can check this by going to Wikipedia's 'My preferences' then the 'Appearance' tab; if anything other than MonoBook is selected, you need to use the 'Custom JS' link to the right of the selected option, instead of monobook.js. So for example if you're taking part in the usability initiative, you should put the script in vector.js instead of monobook.js. Also, the script won't work if you've got JavaScript disabled; and might not work if your computer clock is set wrong. Hope this helps! Mike1024 (t/c) 09:14, 2 September 2009 (UTC)
- Ah, that might help.--EdgeNavidad (talk) 09:59, 2 September 2009 (UTC)
Another way to enforce a wikibreak
Set your firewall to add wikipedia.org and wikimedia.org to the blocked-site list!
Of course, unplugging your modem works too.
Hey, when you need a break, you gotta do what you gotta do. davidwr/(talk)/(contribs)/(e-mail) 01:25, 1 December 2009 (UTC)
- Ha, that's what they do at school to keep us off! PCHS-NJROTC (Messages) 22:34, 23 February 2010 (UTC)
Clearer instructions would be nice
I can't exactly figure this thing out, and I don't want to do it incorrectly. Couldn't someone provide clearer instructions for this? PCHS-NJROTC (Messages) 22:36, 23 February 2010 (UTC)
- Here are some instructions - can you tell me where in these instructions you get confused?
- 1. Copy the code between /*** BEGIN WIKIBREAK ENFORCER ***/ and /*** END WIKIBREAK ENFORCER ***/ to your monobook.js
- 2. Edit the lines starting "var date" and "var time" to reflect the time you want your break to end
- 3. Save the edited monobook.js.
- 4. Reload a wikipedia page, with F5, Ctrl+F5, or Ctrl+Shift+F5 (depending on your browser)
- 5. Enjoy your wikibreak!
- If you could tell me which line of those instructions you find confusing, I'll see if I can clarify them! Mike1024 (t/c) 10:51, 24 February 2010 (UTC)
- Can you please add these instructions to the page! The present version is really not helpful. Why two lines for example? Does hours = 20 refer to being away for only twenty hour or 8 pm? If the latter, is that UTC or local time? Presumably it should be Vector now? Why not just use skin.js, in fact? And yes I need a wikibreak! But...! --Jubilee♫clipman 02:04, 24 May 2010 (UTC)
Rewording
{{editprotected}} Could an administrator replace this
“ | In cases of errors, an admin will have to delete the script in your monobook.js for you. | ” |
with this
“ | In cases of errors, an admin will have to edit the script in your monobook.js for you. | ” |
since an administrator would only need to edit the script rather than delete it in order to end the wikibreak enforcer. Thanks. Set Sail For The Seven Seas 267° 19' 30" NET 17:49, 27 March 2010 (UTC)
- I have changed it to "remove" instead. Anyways, I unprotected the page so people don't need an administrator to edit the page. —TheDJ (talk • contribs) 11:57, 28 March 2010 (UTC)
importScript?
Why not just make this into a script that can be imported, then simplify the settings even further, like the following:
importScript('wikibreak enforcer.js'); wikibreakEnforcer = { endDate: "2010-01-01 12:00:00" }
Seems a lot cleaner than having people who don't know much about JavaScript to import this huge chunk of code. This is probably the most widely used script that needs to be copy and pasted rather than imported. Gary King (talk) 18:26, 25 April 2010 (UTC)
Time on your Computer Needs to be Correct
Your computer's time needs to be correct because once that your computer's time is further than the specified time, it allows you to log in. Keyboard mouse (talk) 03:57, 7 May 2010 (UTC)
Begin on future date
Could you put this script in, with a way to begin it on a future date. - Talk to you later, Presidentman (talk) Random Picture of the Day 14:57, 31 May 2010 (UTC)
Enforcer Doesn't Work
It either doesn't work or it only works from one IP address at a time. I used the code this afternoon while at work (here's the edit), and it worked. I tried to log back in and a message popped up reminding me that I'm on an enforced Wikibreak. I logged on from home for some bedtime reading and noticed that I was logged in under my account and was able to edit. So, here I am, while under an "enforced" Wikibreak making an edit. My work computer is Ubuntu, while my home computer is Windows 7. — Fly by Night (talk) 03:05, 11 February 2011 (UTC)
Made an error
Hello, I am User:Presidentman, I recently made an error while using this script, is there anyway someone can help? - 74.171.71.173 (talk) 11:17, 28 February 2011 (UTC)
An admin will have to remove the script from your skin.js. I, unfortunately, cannot help. Onyx321 (talk) 20:20, 2 March 2011 (UTC)
need help
seriously i need a wikibreak but i don't know how to work this thing. i want to be off for the entire month of september. how can i program that?--Screwball23 talk 02:54, 6 August 2011 (UTC)
I need to stop the break
How can I un-enforce the wikibreak? It isn't working I just keep posting without logging in. I need to work on my wikiproblems at a deeper level I guess. I am User:Maunus by the way - please help me remove the enforcer if you can.128.148.211.79 (talk) 18:16, 15 April 2012 (UTC)
Can't get it to work
Could someone help and tell me what I'm doing wrong? I copy-pasted the script to http://en.wikipedia.org/wiki/User:Tenebrae/vector.js, added my specific numbers, saved it, cleared my cache, and hit reload. Doesn't work. Any ideas? With thanks -- Tenebrae (talk) 00:33, 26 September 2012 (UTC)
- @Tenebrae: have you tried putting it in your common.js page? Flooded with them hundreds 13:48, 1 December 2018 (UTC)
Question to the JavaScripters: Will this work from common.js?
Sorry, if this seems obvious to others. I just created common.js for another script. I like this one. Can I add it to common.js and have it work, or do I have to add it to a theme-specific .js file (and isn't that sort of a problem with a general self-block in and of itself?)? Thanks. —Aladdin Sane (talk) —Preceding undated comment added 05:57, 23 March 2015 (UTC)
Script is no longer apparently compatible with the Logout methods used currently...
The code in question being in my common.js here (and on some other wikis) : https://en.wikipedia.org/wiki/User:ShakespeareFan00/common.js (currently commented)
being the code from https://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/WikiBreak_Enforcer
Sequence of actions taken (with script code active):
- Log into a a wiki with SUL, where the enforcer script is not active.
- Navigate from that wiki back to English Wikipedia, or via a link in a search engine.
- Wait for the enforcer script to generate it's first message.
- Click the acknowledgement in that message.
Expected behavior:
Enforced Log out on the wiki concerned, and return to the main-page of the wiki in question per the intent of the script.
Observed behavior:
Log out does not seemingly occur, and an error page about using the UI provided logout page is generated. The script then regenerates the Wiki break enforcement notice. Acknowledging it again regenerates the error page and the enforcement notice in an apparently un-ending repeating cycle.
ShakespeareFan00 (talk) 12:21, 6 May 2019 (UTC)
- See also the comment I left at - https://phabricator.wikimedia.org/T222582#5159683 . ShakespeareFan00 (talk) 12:48, 6 May 2019 (UTC)
Protected edit request on 16 March 2021
This edit request to Wikipedia:WikiProject User scripts/Scripts/WikiBreak Enforcer has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Please change the link to WP:LOGIN (which now redirects to Wikipedia:Why create an account?) to Help:Logging in, which actually describes logging in. JJP...MASTER![talk to] JJP... master? 12:07, 16 March 2021 (UTC)
Protected edit request on 26 March 2021
This edit request to Wikipedia:WikiProject User scripts/Scripts/WikiBreak Enforcer has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Change {{Wikipedia:WikiProject User scripts/Scripts/WikiBreak Enforcer/script.js}}
to {{#tag:syntaxhighlight|{{Wikipedia:WikiProject User scripts/Scripts/WikiBreak Enforcer/script.js}}|lang=javascript}}
so the script gets syntax highlighted. * Pppery * it has begun... 13:59, 26 March 2021 (UTC)
How to circumvent the script
Think. THINK.
The WikiBreak enforcer runs in the common.js file. JS is for Javascript. Most browsers have a "Disable Javascript" option that blocks Javascript. Therefore, all you have to do is disable the JavaScript, which disables the WikiBreak Enforcer.
I found this when I accidentally locked myself out of my account using the WikiBreak Enforcer. --littleb2009 (she/her) (talk • contribs) 20:16, 5 June 2021 (UTC)