• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

I made some NeoGAF Chrome extensions

Status
Not open for further replies.

Drago

Member
eRVnmns.gif

This should be one the quick reply smilies as well. Jus sayin. :)

(also, if you don't mind would you be able to update the smilies into the new post smiley extension? They only show up for quick reply.)
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
YES

OK, I think I have all the bugs ironed out. I'll be posting for the next hour trying to see if it doesn't break anywhere. Man, this was a doozy, but I'm glad I stuck to my guns and did the right thing even though Chrome made it really difficult. :)

This should be one the quick reply smilies as well. Jus sayin. :)

(also, if you don't mind would you be able to update the smilies into the new post smiley extension? They only show up for quick reply.)

Yes, that's next on my list. :)
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
Update 2.3

  • Actually fixes the security token issue as well as troubles with the editor not being initialized. Should be much more tolerable against failure.
  • Added back the grinning smiley of GAF yesteryear as well as a new *shrug* emote.
    3AQmK.gif
    wtzgU.gif
To update, go to chrome://extensions, hit the Developer Mode checkbox, and click "Update extensions now."
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
3AQmK.gif


I hope it doesn't break in a bit like when I first "fixed" it, but there's less than a 1% chance of that happening... hopefully. Apologies to anyone who lost posts due to the bugs.

For the technically minded, I needed access to the global variables "SECURITYTOKEN" and "vB_Text_Editor" (a function to instantiate the dynamic controls on post areas.) Chrome doesn't allow you to access these variables from within content scripts normally. To work around this, what you can do is create a script element and inject it into the page with what you need. This script will run within the context of the page itself (but it can't use any fancy Chrome extension API's.)

What was tripping me up is that vB_Text_Editor exists in its own file, vbulletin_textedit.js, and this file is only loaded some of the time. I have to make sure it's always loaded, and then run the injected security token/text editor instantiation script when it's finished loading. Thus, giving this code:

Code:
var script = document.createElement('script');
script.src = '/forum/clientscript/vbulletin_textedit.js';
document.body.appendChild(script);
script.onload = function () {
  vB_Editor['vB_Editor_001'] = new vB_Text_Editor('vB_Editor_001', 0, '20', '1', undefined, '');
  document.getElementById('quick-reply-security-token').value = SECURITYTOKEN;
};

It might seem a little wasteful to always inject the code, so there might be room for optimization here if vB_Text_Editor is actually defined, but the browser is smart about caching and URLs so at best it's just reloading the file, and not keeping both in memory. (I might be wrong about that though, since GAF cachebusts the file and I do not...)

As I mentioned, the extension was very poorly coded before. Basically what it did was embed a big blob of HTML in an escaped string in the JavaScript. This actually got around the content policy issue above, so it worked, but it was ugly as hell and very hard to maintain. I had a separate HTML file that I would update, then run through a light "minification" process to strip out the tabs and line breaks and escape the single quote marks. Bad, bad practice. I also greedily loaded jQuery when all I used it for was appending said string below a certain element at the bottom of the page (this is probably where the extension broke with the new GAF design -- that element likely doesn't exist anymore.)

What I do now is directly AJAX the quick reply HTML file (this meant I couldn't leave the script instantiation inside it, security strips it out.) I replace the threadID and postID hidden input variables with ones I strip from the URL, then I AJAX the above instantiation script and append it to the quick reply's HTML. Then I append the HTML to #main .wrap. In all of this, I used the VanillaJS versions, which meant I didn't even need to load jQuery anymore. Removing that dependency yielded more than a 3x size decrease in the extension, which makes me a little happy. :)

Anyways, the code should be hitting the GitHub on Monday if anyone is truly interested, lol.

Oh and Stump, GAF's new design really didn't make much of a difference lol, the post editor is still all tables. :p

Edit- Code is now on GitHub thanks to Cloud9. It's possible to code on Chrome OS after all!
 

Mengetsu

Member
Update 2.3

  • Actually fixes the security token issue as well as troubles with the editor not being initialized. Should be much more tolerable against failure.
  • Added back the grinning smiley of GAF yesteryear as well as a new *shrug* emote.
    3AQmK.gif
    wtzgU.gif
To update, go to chrome://extensions, hit the Developer Mode checkbox, and click "Update extensions now."


3AQmK.gif
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
Thinking about it, I think I will roll Image Upload and NeoGAF Smilies into Quick Reply. It just makes much more sense for them to be share the same code and settings (especially when I add the "Add your own smiley" feature.)

I want to call it "NeoGAF++" unless a better name presents itself...
 

Mengetsu

Member
Thinking about it, I think I will roll Image Upload and NeoGAF Smilies into Quick Reply. It just makes much more sense for them to be share the same code and settings (especially when I add the "Add your own smiley" feature.)

I want to call it "NeoGAF++" unless a better name presents itself...

EWmof.gif
p0QHO.gif


How about "NeoGAF Pro" Or "NeoGAF Reply Pro" Just a random though lol
 

GAMERG0D

Member
Update 2.3

  • Actually fixes the security token issue as well as troubles with the editor not being initialized. Should be much more tolerable against failure.
  • Added back the grinning smiley of GAF yesteryear as well as a new *shrug* emote.
    3AQmK.gif
    wtzgU.gif
To update, go to chrome://extensions, hit the Developer Mode checkbox, and click "Update extensions now."
When I try to update nothing happens at all.
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
EWmof.gif
p0QHO.gif


How about "NeoGAF Pro" Or "NeoGAF Reply Pro" Just a random though lol

Hmm... Pro is OK. ++ is OK too.

Back in the day I was gonna use "NeoGAF Gold" but that seems less usable now that you can make the actual logo appear using the Konami code.

When I try to update nothing happens at all.

Give it a few minutes. If you have a big extension that needs to be updated I think Chrome will do that first.

If by later today you don't have 2.3 then that's probably a serious issue with Chrome...
 

Mengetsu

Member
I thought smilies were illegal.

They are but, the mods allow moderate use from us I guess due to the fact that it's an extension and not everyone can get there hands on it who doesn't know about it. I'm sure it was taken down a long time ago due to people abusing I assume.
 

strafer

member
They are but, the mods allow moderate use from us I guess due to the fact that it's an extension and not everyone can get there hands on it who doesn't know about it. I'm sure it was taken down a long time ago due to people abusing I assume.

It's weird because its the same deal with gifs. Which are used even more.
 

Brofield

Member


Holy balls, awesome

Oh godDAMN please tell me you have that as an even bigger gif. (Make one hella sweet animated wallpaper)

Definitely got the image upload ext, that'll be great. Is there any way an extension would be developed to allow for animated gifs not crashing and working reasonably well in Chrome? I'm not a coder by nature so I don't even know if it's feasible and simply just a drawback from using Chrome.
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
Super Ignore has not been updated to NeoGAF 2013 yet, but it should be soon.

Please understand.
 

Gui_PT

Member
Not sure if this a known bug, but this is happening with the Super Ignore enabled whenever someone ignored posts:


NOTE: The bottom looks like that because I cropped the picture quickly in paint.

It's actually doing a super job by ignoring everyone

Seriously though, we understand that things aren't going to be updated immediately
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
NeoGAF++ will go live later today. It will include Quick Reply and Super Ignore. It might also include Smilies (with the ability to add your custom ones), but that's a bit touch and go. Image Upload and Messages will have to wait until a future release, but the standalone extensions work fine today as far as I can tell.
NeoGAF++ will also include one secret, just-for-fun extension bundled in. ;)

Super Ignore as included in NeoGAF++ will be fixed, obviously, but also seriously enhanced. I've added two new optional features:

1. Hide entire threads in the forum view from members on your ignore list.
2. Hide any posts that include quotes by members on your ignore list.

(As a heads-up, the extension has a background page that needs to poll your ignore list every hour to get this information.)

If you have NeoGAF Quick Reply installed in Chrome, you will be automatically updated to NeoGAF++ later today. Anyone using the standalone Super Ignore and Smilies extensions, I would advise you to switch to NeoGAF++ as soon as you're able, as it will be the only one I support going forward.
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
NeoGAF++ is now live in the Chrome Web Store.

Versions 3.0 and 3.1 were a little bugged with settings after install, but 3.2 should be good. Please report any bugs here as soon as you find them. I'm also taking feature requests.

Super Ignore is turned on by default, but the two extra options (hide quoted posts and hide threads) are not. To toggle these options, go to chrome://extensions and search for NeoGAF++, then click Options.

If you were running NeoGAF Quick Reply, to update to NeoGAF++, go to chrome://extensions, hit the Developer Mode checkbox, and click "Update extensions now."
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
KuGsj.gif
Wow. Might be time to get away from the computer for a bit. Spent 3am-7am this morning coding this thing.
 

Ran rp

Member
How do you save NeoGAF++ options? Every time I check off Quick Reply and close the extension's page it unchecks itself and Quick Reply never turns on.

Edit: Uninstalled and re-installed it and it works now. Something must have happened during the NeoGAF Quick Reply -> NeoGAF++ update.
 

ThatObviousUser

ὁ αἴσχιστος παῖς εἶ
PSY・S;67480836 said:
How do you save NeoGAF++ options? Every time I check off Quick Reply and close the extension's page it unchecks itself and Quick Reply never turns on.

It sounds like you have one of the bugged versions (3.0/3.1.) Uninstall and re-install the extension and let me know if it's still happening.
 
Status
Not open for further replies.
Top Bottom