Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 819689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:21:09+00:00 2026-05-15T02:21:09+00:00

First the background: In Firefox 3.6.3 on Mac OS X 10.5.8 when entering text

  • 0

First the background:

In Firefox 3.6.3 on Mac OS X 10.5.8 when entering text into a standard the hotkey combination of Command+LeftArrow and Command+RightArrow jump the cursor to the start/end of the current line, respectively. However, when using CKEditor, FCKEditor and YUI Editor, Firefox does not seem to completely recognize that it’s a text area. Instead, it drops back to the default function for those hotkeys which is to move back/forward in the browser history. After this occurs, the text in the editor is also cleared when you return to the page making it very easy to loose whatever is being worked on.

I’m attempting to write a greasemonkey script that I can use to capture the events and prevent the page forward/back jumps from being executed. So far, I’ve been able to see the events with the following used as a .user.js script in GreaseMonkey:

document.addEventListener('keypress', function (evt) {
// grab the meta key
var isCmd = evt.metaKey;

// check to see if it is pressed
if(isCmd)
{
  // if so, grab the key code;
  var kCode = evt.keyCode;

  if(kCode == 37 || kCode == 39)
  {
    alert(kCode);
  }
}

},
false
);

When installed/enabled, pressing command+left|right arrow key pops an alert with the respective code, but as soon as the dialog box is closed, the browser executes the page forward/back move. I tried setting a new code with evt.keyCode = 0, but that didn’t work.

So, the question is, can this Greasemonkey script be updated so that it prevents the back/forward page moves?

(NOTE: I’m open to other solutions as well. Doesn’t have to be Greasemonkey, that’s just the direction I’ve tried. The real goal is to be able to disable the forward/back hotkey functionality.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:21:09+00:00Added an answer on May 15, 2026 at 2:21 am

    Add return false; after alert(kCode);
    That should do it most of the time.

    May also have to add:

    evt.preventDefault();
    and/or
    evt.stopPropagation();
    

    These two functions work on most FF editions, but I’m not sure about the Mac.
    Also, usually, your func will fire after the editor script. But, if it fires before, it could disable that cursor jump.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First some background. I inherited a project where the build file was already written
First some background: I've got a Rails 2.2.2 app with all kinds of janky
First some background: I'm working on an application and I'm trying to follow MVVM
A little background first. I've been tasked with encrypting files with a Powershell script
A little background first: I'm a designer/developer and decided to use subversion for a
A bit of background first: I am using base code from a remote SVN
Hi and thanks for looking! Background First, I am an absolute n00b to WPF/Silverlight/XAML.
First a little background: I have already managed to connect to a Microsoft SOAP
As usual, some background information first: Database A (Access database) - Holds a table
First a bit of background. I have been working on the MS platform for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.