# Mafia players: SD Mafia Tools (Chrome extension)

**URL:** <https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010>\
**Category:** The Game Room\
**Created:** [December 4, 2011, 5:36am UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010 "2011-12-04T05:36:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![fubbleskag](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@fubbleskag](https://boards.straightdope.com/u/fubbleskag)\
**Post date:** [December 4, 2011, 5:36am UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/1 "2011-12-04T05:36:12Z")

</div>

During the last few Mafia games I’ve played, I found myself wanting to be able to quickly filter the posts on the current page for various reasons. Today, I decided to package a few of these filters into a Chrome extension (sorry FF/Greasemonkey users, no love for you [yet?]).

Version 1.0 is available [here](http://www.thebluetoque.com/dev/SDMB%20Mafia%20Tools.crx) and contains the following filters:  
[ul]  
[li]By Username[/li][li]Online Players[/li]liVoters[/li][/ul]  
I’m looking for ideas for more filters or other functionality to add, so please give it a tumble and let me know what you think.

Note: if you wish to inspect the code before installing the extension, download the file from the link above, change the file extension to .zip and then view the contents with your favourite archive program.

---

<div class="post-metadata">

**Author:** ![fubbleskag](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@fubbleskag](https://boards.straightdope.com/u/fubbleskag)\
**Post date:** [December 4, 2011, 2:28pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/2 "2011-12-04T14:28:28Z")

</div>

So, I already have some ideas for stuff to add to the next version:

- the ability to give each player in a game a town/scum rating; I’m thinking a scale of +5 through -5 with 0 being the default (neutral) and the extremes being for confirmed/dead players
- filters to only show posts from players with certain ratings/ranges
- right now the toolbar is shown on any SDMB thread; it’s fairly unobtrusive, but I think I can find a way to only have a small icon appear in the address bar on threads with ‘mafia’ in the title; clicking the icon would then display the toolbar and add that thread to a list of threads to automatically display the toolbar when reading (a close button would be added to the toolbar which would remove a thread from this list)
- I’d also like to add a toolbar button that will retrieve all posts from all pages in the thread via an ajax call and display them in the current page; this would make the filters a lot more useful, I think, being able to filter the entire game instead of just a single page, which even when set to 200 posts per page is usually not an entire Day
- also considering changing the filter setup from being single filter buttons to a set of checkboxes to allow the use of multiple filters; this is lower priority unless I get the page consolidation function working and add more filters first

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [December 4, 2011, 8:55pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/3 "2011-12-04T20:55:48Z")

</div>

How does your script recognize voters/unvoters? Does it assume a color scheme, or does it look for the word “vote” (or “unvote”) followed by a username? Does it correctly deal with quoted votes?

---

<div class="post-metadata">

**Author:** ![fubbleskag](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@fubbleskag](https://boards.straightdope.com/u/fubbleskag)\
**Post date:** [December 4, 2011, 9:09pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/4 "2011-12-04T21:09:58Z")

</div>

> [@Chronos](#):
>
> How does your script recognize voters/unvoters? Does it assume a color scheme, or does it look for the word “vote” (or “unvote”) followed by a username? Does it correctly deal with quoted votes?

The vote filter looks for any coloured text, excluding green, containing the word “vote”; assuming quoters bleach the votes like they’re supposed to, this should suffice. I’ll look into automatically excluding quoted votes, it should be doable, I think.

---

<div class="post-metadata">

**Author:** ![fubbleskag](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@fubbleskag](https://boards.straightdope.com/u/fubbleskag)\
**Post date:** [December 6, 2011, 10:14pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/5 "2011-12-06T22:14:49Z")

</div>

> [@fubbleskag](#):
>
> - I’d also like to add a toolbar button that will retrieve all posts from all pages in the thread via an ajax call and display them in the current page; this would make the filters a lot more useful, I think, being able to filter the entire game instead of just a single page, which even when set to 200 posts per page is usually not an entire Day

I was able to get this sorted for the most part; just need to figure out why it seems to be breaking the vBulletin multi-quote function…

---

<div class="post-metadata">

**Author:** ![Meeko](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Meeko](https://boards.straightdope.com/u/Meeko)\
**Post date:** [December 7, 2011, 2:53am UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/6 "2011-12-07T02:53:13Z")

</div>

> [@Chronos](#):
>
> How does your script recognize voters/unvoters? Does it assume a color scheme, or does it look for the word “vote” (or “unvote”) followed by a username? Does it correctly deal with quoted votes?

\*\*  
OH HELL NO. \*\*

Chronos wrote this…  
\*\*

Double Hell no.\*\*  
But hey, can you make an extension that makes me sound coherent? I think Big T might be bothered to help you.

---

<div class="post-metadata">

**Author:** ![Meeko](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Meeko](https://boards.straightdope.com/u/Meeko)\
**Post date:** [December 7, 2011, 2:54am UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/7 "2011-12-07T02:54:22Z")

</div>

NETA : Or at least a mafia extension that gives me 25 hours in the day, so that I can re-join you guys.

---

<div class="post-metadata">

**Author:** ![Suburban\_Plankton](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/suburban_plankton/32/219_2.png) [@Suburban\_Plankton](https://boards.straightdope.com/u/Suburban_Plankton)\
**Post date:** [December 7, 2011, 4:30am UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/8 "2011-12-07T04:30:14Z")

</div>

The “By Username” filter doesn’t seem to be doing anything…what am I doing wrong?

I’m using version 16.0.912.59 beta

---

<div class="post-metadata">

**Author:** ![fubbleskag](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@fubbleskag](https://boards.straightdope.com/u/fubbleskag)\
**Post date:** [December 8, 2011, 12:39pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/9 "2011-12-08T12:39:16Z")

</div>

> [@Suburban\_Plankton](#):
>
> The “By Username” filter doesn’t seem to be doing anything…what am I doing wrong?
> 
> I’m using version 16.0.912.59 beta

that version is currently unsupported and is likely deleting files from your hard drive as we speak.

---

<div class="post-metadata">

**Author:** ![Suburban\_Plankton](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/suburban_plankton/32/219_2.png) [@Suburban\_Plankton](https://boards.straightdope.com/u/Suburban_Plankton)\
**Post date:** [December 9, 2011, 3:07am UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/10 "2011-12-09T03:07:32Z")

</div>

Well, lucky for me that it’s now updated to 16.0.912.63.

Whew! I really dodged a bullet there, didn’t I?

---

<div class="post-metadata">

**Author:** ![Suburban\_Plankton](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/suburban_plankton/32/219_2.png) [@Suburban\_Plankton](https://boards.straightdope.com/u/Suburban_Plankton)\
**Post date:** [December 9, 2011, 5:58pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/11 "2011-12-09T17:58:42Z")

</div>

And it works now 🙂

---

<div class="post-metadata">

**Author:** ![fubbleskag](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@fubbleskag](https://boards.straightdope.com/u/fubbleskag)\
**Post date:** [December 9, 2011, 7:29pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/12 "2011-12-09T19:29:25Z")

</div>

> [@Suburban\_Plankton](#):
>
> And it works now 🙂

I am planning to eventually update that filter so that players can be chosen from a list rather manually entered…

---

<div class="post-metadata">

**Author:** ![fubbleskag](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@fubbleskag](https://boards.straightdope.com/u/fubbleskag)\
**Post date:** [April 17, 2012, 6:00pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/13 "2012-04-17T18:00:04Z")

</div>

> [@fubbleskag](#):
>
> I am planning to eventually update that filter so that players can be chosen from a list rather manually entered…

I did this eons ago but apparently didn’t upload the change, which I’ve just done.

---

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [April 19, 2012, 4:49am UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/14 "2012-04-19T04:49:04Z")

</div>

May I ask what the trouble is in getting it to work in GreaseMonkey on Firefox?

---

<div class="post-metadata">

**Author:** ![fubbleskag](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@fubbleskag](https://boards.straightdope.com/u/fubbleskag)\
**Post date:** [January 25, 2013, 12:48pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/15 "2013-01-25T12:48:14Z")

</div>

The link in the OP has now been updated to version 2.0 which is just a fancy way of saying that the manifest.json file has been updated to the new format required by Chrome.

It seems the little icon I included in the toolbar has been broken by the update, I’ll get around to fixing that soon™.

Just to re-cap, these are the functions that this extension provides for in it’s current state:

- Page consolidation: at a button click, all pages of the current thread will be consolidated and loaded into the browser; on really long game threads this can take a few seconds, but I find that it makes the filters below more useful

- Filters: at a button click, or via drop-down, the posts on the page can be filtered to show only a specific player or all posts containing un-bleached votes

Edit: a known bug - after page consolidation, multi-quote toggling is broken (and possibly some other cookie-related features)

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [January 25, 2013, 4:57pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/16 "2013-01-25T16:57:50Z")

</div>

> [@](#):
>
> - Filters: at a button click, or via drop-down, the posts on the page can be filtered to show … all posts containing un-bleached votes

Hm, that could be really useful. Now all we need is a fuzzy-matching routine to correct misspelled or nicknamed usernames and count up the totals.

Actually, one other more realistic request: Would it be possible to add a filter for end-of-Day/Night posts? Or at least, posts by the moderator of the game? It’s useful when looking at vote posts to be able to see at a glance which Day they were made on.

---

<div class="post-metadata">

**Author:** ![Dizzymrslizzy](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dizzymrslizzy](https://boards.straightdope.com/u/Dizzymrslizzy)\
**Post date:** [January 25, 2013, 7:19pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/17 "2013-01-25T19:19:59Z")

</div>

I’m dumb, I can’t figure out how to install a chome extension…  
\<—Ex- IT consultant at her finest right now! LMAO

---

<div class="post-metadata">

**Author:** ![Mahaloth](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mahaloth/32/1079_2.png) [@Mahaloth](https://boards.straightdope.com/u/Mahaloth)\
**Post date:** [January 25, 2013, 9:05pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/18 "2013-01-25T21:05:36Z")

</div>

My chrome said it will not install extensions from this web site. How do I change that?

---

<div class="post-metadata">

**Author:** ![Dizzymrslizzy](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dizzymrslizzy](https://boards.straightdope.com/u/Dizzymrslizzy)\
**Post date:** [January 25, 2013, 9:31pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/19 "2013-01-25T21:31:27Z")

</div>

That’s where I’m at too Mahaloth!

---

<div class="post-metadata">

**Author:** ![Mahaloth](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mahaloth/32/1079_2.png) [@Mahaloth](https://boards.straightdope.com/u/Mahaloth)\
**Post date:** [January 26, 2013, 4:55pm UTC](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010/20 "2013-01-26T16:55:46Z")

</div>

> [@Mahaloth](#):
>
> My chrome said it will not install extensions from this web site. How do I change that?

Anyone?

[Next page](https://boards.straightdope.com/t/mafia-players-sd-mafia-tools-chrome-extension/605010.md?page=2)
