EmailDiscussions.com  

Go Back   EmailDiscussions.com > Email Service Provider-specific Forums > FastMail Forum
Register FAQ Members List Calendar Today's Posts
Stay in touch wirelessly

FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc.

Reply
 
Thread Tools
Old 9 May 2014, 09:52 AM   #1
robmueller
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==
Now add the following line under the @grant line:

Code:
// @match https://*.fastmail.fm/html/*
3. Go back to a browser tab, login to FastMail
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.
robmueller is offline   Reply With Quote

Old 12 May 2014, 10:44 AM   #2
robmueller
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');
   }
});
Would become:
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');
}
Note we removed the 'addEvent' line, and the corresponding "});" line at the end.
robmueller is offline   Reply With Quote
Old 15 May 2014, 03:15 AM   #3
joe_devore
Essential Contributor
 
Join Date: Dec 2003
Location: Dover, NH, USA
Posts: 315
Wink

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');
}
and it works.... it looks like I will have to create it new each and every time I get on to the PCs at my local Library for internet... because it wipes all changes when the PC is restarted (SmartShield)

or create a batch file to copy it
joe_devore is offline   Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +9. The time now is 01:52 AM.

 

Copyright EmailDiscussions.com 1998-2022. All Rights Reserved. Privacy Policy