|
FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc. |
|
Thread Tools |
9 May 2014, 09:52 AM | #1 |
Intergalactic Postmaster
Join Date: Oct 2001
Location: Melbourne, Australia
Posts: 6,102
Representative of:
Fastmail.FM |
Removing tweaks.js
Due to some security issues we've recently become aware of, we have to remove tweaks.js support. I emailed everyone that has an active tweaks.js file yesterday to let them know.
The closest equivalent is greasemonkey (firefox) or tampermonkey (chrome). Here's some instructions for setting up: 1. Install Greasemonkey into Firefox 2. Go to Tools -> Greasemonkey -> New user script. For each field shown enter: Name: FastMail Tweaks Namespace: https://www.fastmail.fm/tweaks Description: (anything you want) Includes: (delete any values and leave blank) Excludes: (blank) You should end up with a default script editor that looks like: Code:
// ==UserScript== // @name FastMail Tweaks // @namespace https://www.fastmail.fm/tweaks // @version 1 // @grant none // ==/UserScript== Code:
// @match https://*.fastmail.fm/html/* 4. Navigate to the Files screen and the "custom-ui/js" folder 5. Click "(details)" next to the "tweaks.js" filename 6. You should see an "Edit Content" section with your script. Select all the content and copy to the clipboard 7. Go back to the greasemonkey editing window. Paste the clipboard content at the very end of the editing area, underneath all the existing lines 8. Click Save That should be it. At that point the script should be installed and running again on your pages. You might need to make changes to the script depending on what it does. For instance, some scripts attempt to load additional scripting content (e.g. aes.js). That won't work because the aes.js script isn't in the same location as the tweaks.js anymore. Using @require and @resource is the solution to this, but I haven't got a simple way to set this up for people. |
12 May 2014, 10:44 AM | #2 |
Intergalactic Postmaster
Join Date: Oct 2001
Location: Melbourne, Australia
Posts: 6,102
Representative of:
Fastmail.FM |
Since someone asked me, one main thing you have to do is remove any "addEvent('domready', ...)" part. The reason is the script already runs at 'domready' time. You will need to leave any "addEvent('keydown', ... )" parts.
So for instance: Code:
// Notepad screen: move "Create new note" button to top, followed by "Sort by" // -- Updated by Bill n5bb (2011.05.02) window.addEvent('domready', function () { if ($('notepad')) { ($$('div.sortBy')[0]).inject($$('.collapseContainer')[0],'top'); ($$('li.listButton')[0]).inject($$('.collapseContainer')[0],'top'); } }); Code:
// Notepad screen: move "Create new note" button to top, followed by "Sort by" // -- Updated by Bill n5bb (2011.05.02) if ($('notepad')) { ($$('div.sortBy')[0]).inject($$('.collapseContainer')[0],'top'); ($$('li.listButton')[0]).inject($$('.collapseContainer')[0],'top'); } |
15 May 2014, 03:15 AM | #3 |
Essential Contributor
Join Date: Dec 2003
Location: Dover, NH, USA
Posts: 315
|
Thx Rob ;^_^
Here is the complete JS Tweaks for GreaseMonkey for the Notes Screen Tweaks (not including the AES.js stuff yet) FILE-NAME: [FastMail_Tweaks.user.js] Code:
// ==UserScript== // @name FastMail Tweaks // @namespace https://www.fastmail.fm/tweaks // @version 1 // @grant none // @match https://*.fastmail.fm/html/* // ==/UserScript== // Notepad screen: move "Create new note" button to top, followed by "Sort by" // -- Updated by Bill n5bb (2011.05.02) // -- Updated Grease Monkey ready by "robmueller" (2014.05.10) if ($('notepad')) { ($$('div.sortBy')[0]).inject($$('.collapseContainer')[0],'top'); ($$('li.listButton')[0]).inject($$('.collapseContainer')[0],'top'); } or create a batch file to copy it |