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 8115007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:19:36+00:00 2026-06-06T03:19:36+00:00

So, I have GreaseMonkey Script that does some operations with integers and then sets

  • 0

So, I have GreaseMonkey Script that does some operations with integers and then sets value via GM_setValue.

Code:

  var A = parseInt(StringA);
  var B = parseInt(StringB);
  var C = parseInt(StringC);
  var answer = parseInt(Math.floor(Math.max((A/B),1)*C));
  GM_setValue("answer",answer);

Now this works perfectly fine in Chrome, but somehow fails in Firefox, giving

Error: Unsupported type for GM_setValue. Supported types are: string, bool, and 32 bit integers.

The value A, B and C are properly being exported, even the value of answer is calculated as expected. Checked it with alert dialogue-boxes.
Only problem is, it is not setting value via GM_setValue. Earlier I wasn’t doing parseInt on var answer as type of Math.floor already should return the integer, but just doing it anyway. (In both cases answer is correct, but giving errors.)

I fail to understand what’s going wrong here. Any helps is greatly appreciated.

Edit: Not sure how it matters, but here’s the sample output via alert("A: "+A+"\nB: "+B+"\nC: "+C+"\n\nAnswer: "+answer);

A: 41751
B: 20513
C: 190164861567

Answer: 387050803650
  • 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-06-06T03:19:37+00:00Added an answer on June 6, 2026 at 3:19 am

    Try to add radix value to your parseInt function:

    parseInt(Math.floor(Math.max((A/B),1)*C), 10);
    

    Update:

    Your value is too big for GM scripts to store. The max 32-bit supported number in mozilla 2147483647 see here.

    To store your value try to convert it to string for example:

    GM_setValue("answer", "" + answer + "");
    

    or using toString() method:

    GM_setValue("answer", answer.toString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Greasemonkey script that dynamically inserts an HTML form into some web
I have a simple greasemonkey script that makes some simple dom manipulation. The greasemonkey
I have created a Greasemonkey script that runs fine in the firebug editor, with
Do you have any link\example of Greasemonkey script with Jquery that works in Google
I have a Greasemonkey script that prints a div -- works! However, I'd like
I have this Greasemonkey script that works fine in the Fiddle. It's designed to
So I have a greasemonkey script that I am adding onto, and one of
I have a very simple greasemonkey script that I want to call an already
I have a greasemonkey script that opens an iframe containing a form from a
I have a Greasemonkey script that works just fine in Firefox and Opera. I

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.