Skip to main content
GameDev.net gamedev.net
🔒 Locked

Patch for missing characters in previews (Opera)

Started by benryves Jul 13, 2009 at 9:41 AM 2 replies 1.3k views
Original Post
benryves
benryves
Here is a userscript patch for the preview function that fixes the way it displays plus signs and other special characters as spaces.
// ==UserScript==
// @include http://*gamedev.net/community/forums/post.asp*
// ==/UserScript==

window.addEventListener('DOMContentLoaded', function() {
	submitform = eval('function()' + (submitform + '''').replace(/escape\(/g, 'encodeURIComponent(').replace(/function submitform \(\)/, ''''));
}, false);
I'm afraid that I cannot get it to work in Firefox; if I type &#106avascript:alert(submitform)</tt> in the address bar Firefox displays the function as expected, but if I type <tt>submitform</tt> into the error console or try and access it from a userscript Firefox complains that it's not defined. However, I have fixed <a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=509605">both PM preview scripts</a> to use the corrected code!</tt>
[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]
jbadams
jbadams
I'm sure the other Opera user will appreciate it if they ever visit GDNet! [grin] Very cool, if I could rate you any higher I would do so.
- Jason Astle-Adams
benryves
benryves
Quote:
Original post by jbadams
I'm sure the other Opera user will appreciate it if they ever visit GDNet! [grin]
I'd settle for one of the myriad Firefox users explaining why it doesn't seem to think submitform is defined. Opera and IE seem to agree that it is. [oh] Thanks, anyway!
[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]
swiftcoder
swiftcoder
What are the chances of benryves' patches being upstream'd into the actual site code? I assume slim, given that V5 is on its way, but on the flip side, V5 has been on the way for a very long time [smile]
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.