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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:16:13+00:00 2026-05-14T07:16:13+00:00

I need help getting a Grease Monkey with JQuery Script to run on a

  • 0

I need help getting a Grease Monkey with JQuery Script to run on a broken site.

I’m trying to get the following GM script to run, but the page I want it to work on has a JS error and my JS does not get executed.

// ==UserScript==
// @name          BILL INFO PAGE ALTER
// @namespace     http://jenkinslaw.org
// @description   Alter the web page in order to pretty print
// @include       http://www.legis.state.pa.us/cfdocs/billinfo/bill_history.cfm?*
// @require       http://code.jquery.com/jquery-1.4.2.min.js

// ==/UserScript==
*/
(function() {

  //Make a copy of the bill table
  var bill_table = $('.main_table').clone();

  //empty the whole lot
  $(body).empty();

  //append the bill back to the dom.
  $(body).append(bill_table);

}());

Thanks!

D

Progress:

I agree with @mkoryak this is an impossible problem to solve with GM. So I’m dropping it and using a Firefox extension instead (hopefully it wont run into the same issue).

I’ll be following the example I saw on another post here on OS:
How to use jQuery in Firefox Extension

I was able to get it working but with a slight modification from the example shown:

(As an aside, I used the Firefox Extension Wizard to get a basic framework of the extension set-up easily and quickly).

jQuery.noConflict();
(function($){

billinfo = new function(){};
billinfo.log = function(){ Firebug.Console.logFormatted(arguments,null,"log"); };
billinfo.run = function(doc,aEvent) {

  // Check for website
  if(!doc.location.href.match(/^http:\/\/(.*\.)?legis\.state\.pa\.us\/cfdocs\/billinfo\/bill_history\.cfm\?(.*)?$/i)) return; 

  // Check if already loaded
  if(doc.getElementById("plugin-billinfo")) return;

  // Setup
  this.win = aEvent.target.defaultView.wrappedJSObject;
  this.doc = doc;

  //Make a copy of the bill table
  bill_table = $('.main_table', doc).clone();

  //empty the whole lot
  $('body', doc).empty();

  //append the bill back to the dom.
  $('body', doc).append(bill_table);      
}; 

// Bind Plugin
var delay = function(aEvent){ var doc = aEvent.originalTarget; setTimeout(function(){ billinfo.run(doc,aEvent); },1); };
var load = function(){ gBrowser.addEventListener("DOMContentLoaded", delay, true); };
window.addEventListener("pageshow", load, false) 
})(jQuery);
  • 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-14T07:16:14+00:00Added an answer on May 14, 2026 at 7:16 am

    You cant do it.

    If there is a javascript error, your code (which executes last) will never execute.

    I have looked far and wide for a solution for this, but was never able to find it.

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

Sidebar

Ask A Question

Stats

  • Questions 382k
  • Answers 382k
  • 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
  • Editorial Team
    Editorial Team added an answer I used what tster provided, and to get the cssPath,… May 14, 2026 at 10:23 pm
  • Editorial Team
    Editorial Team added an answer I would give a default value for it: if (!isset($_GET['mode'])… May 14, 2026 at 10:23 pm
  • Editorial Team
    Editorial Team added an answer It looks like you will need to use the Digg… May 14, 2026 at 10:23 pm

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.