Wikipedia talk:WikiProject User scripts/Scripts/WikiBreak Enforcer: Difference between revisions
→A better solution?: (no) |
Bluegoblin7 (talk | contribs) →Can someone add this for me?: new section |
||
Line 167: | Line 167: | ||
:::Well, I have [[Kaspersky Internet Security|KIS 7]] ''<small>(∞-day trial)</small>'', 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. ''--[[User:Grawity|grawity]]'' 17:58, 21 June 2008 (UTC) |
:::Well, I have [[Kaspersky Internet Security|KIS 7]] ''<small>(∞-day trial)</small>'', 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. ''--[[User:Grawity|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? |
|||
'''<font face="Gill Sans MT">[[User:Bluegoblin7|<font color="blue">B</font>]][[User talk:Bluegoblin7|<font color="blue">G</font>]][[Special:Contributions/Bluegoblin7|<font color="gray">7even</font>]]</font>''' 15:52, 26 June 2008 (UTC) |
Revision as of 15:52, 26 June 2008
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)
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)
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)
- 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
- Note, our host name does not have a www in it... — xaosflux Talk 01:37, 19 May 2008 (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?