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

  • Home
  • SEARCH
  • 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 45293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:47:10+00:00 2026-05-10T15:47:10+00:00

I’ve got quite a few GreaseMonkey scripts that I wrote at my work which

  • 0

I’ve got quite a few GreaseMonkey scripts that I wrote at my work which automatically log me into the internal sites we have here. I’ve managed to write a script for nearly each one of these sites except for our time sheet application, which uses HTTP authentication.

Is there a way I can use GreaseMonkey to log me into this site automatically?

Edit: I am aware of the store password functionality in browsers, but my scripts go a step further by checking if I’m logged into the site when it loads (by traversing HTML) and then submitting a post to the login page. This removes the step of having to load up the site, entering the login page, entering my credentials, then hitting submit

  • 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. 2026-05-10T15:47:11+00:00Added an answer on May 10, 2026 at 3:47 pm

    It is possible to log in using HTTP authentication by setting the ‘Authorization’ HTTP header, with the value of this header set to the string ‘basic username:password’, but with the ‘username:password’ portion of the string Base 64 encoded.

    http://frontier.userland.com/stories/storyReader$2159

    A bit of researching found that GreaseMonkey has a a function built into it where you can send GET / POST requests to the server called GM_xmlhttpRequest

    http://diveintogreasemonkey.org/api/gm_xmlhttprequest.html

    So putting it all together (and also getting this JavaScript code to convert strings into base64 I get the following

    http://www.webtoolkit.info/javascript-base64.html

    var loggedInText = document.getElementById('metanav').firstChild.firstChild.innerHTML; if (loggedInText != 'logged in as jklp') {     var username = 'jklp';     var password = 'jklpPass';     var base64string = Base64.encode(username + ':' + password);      GM_xmlhttpRequest({         method: 'GET',         url: 'http://foo.com/trac/login',         headers: {             'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey/0.3',             'Accept': 'application/atom+xml,application/xml,text/xml',             'Authorization':'Basic ' + base64string,         }     }); } 

    So when I now visit the site, it traverses the DOM and if I’m not logged in, it automagically logs me in.

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

Sidebar

Ask A Question

Stats

  • Questions 71k
  • Answers 72k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer PDF supports XMP metadata. You should append your plug-in specific… May 11, 2026 at 1:29 pm
  • added an answer If you've not published your repository then this shouldn't be… May 11, 2026 at 1:29 pm
  • added an answer Never is a bad option - pretty much all other… May 11, 2026 at 1:29 pm

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.