Go Back  FlyerTalk Forums > Miles&Points > Airlines and Mileage Programs > United Airlines | MileagePlus
Reload this Page >

Browser extensions/scripts for United.com

Community
Wiki Posts
Search
Old Jun 13, 2014, 3:18 pm
FlyerTalk Forums Expert How-Tos and Guides
Last edit by: sbm12
Note that Chrome recently changed its rules so most users will need to pull scripts from their store to use them.

From sbm12 (available from the Chrome Store or direct download for GreaseMonkey users):
From jasonvr
From Darlox:
Note: Both are defunct (no longer maintained by the creators), have known issues on the current site, will not work on the Beta site, and are of marginal usefulness in the $-based RDM era. Use for reference only.
Print Wikipost

Browser extensions/scripts for United.com

Thread Tools
 
Search this Thread
 
Old Jul 27, 2015, 12:40 pm
  #16  
 
Join Date: Aug 2005
Location: NRT/HND, IWK, SAT, BWI, NAP, OKA, AUS, DEN, COS and PUB
Programs: UA 1K.. 1MM
Posts: 994
This might be of use to a handful of people.. I've loved and utilized this add-on for (what feels like) a really long time. One thing that kinda bugged me about the new site implementation is that the expertmode buckets only show up upon expansion. So, while it's fantastic that the buckets are highlighted, the length of the page increased a ton and the readability went way down.

I made some quick and dirty mods to the .js in the greasemonkey version:

First, I added some code to the end of the highlight() function to copy the pertinent buckets into the pre-details area. I just shoved them in the same area with the other flight segment advisories without much concern for how it ends up moving icons.
Code:
        var segmentLists = getElementsByClassName(document, 'ul','segment-indicators-list');
        for (var i = 0, len = segmentLists.length; i < len; i++) {
            segmentLists[i].innerHTML = segmentLists[i].innerHTML + cabinLists[i].innerHTML.replace(/(?:F|FN|A|J|JN|C|D|Z|ZN|P|Y|YN|B|M|E|U|H|HN|Q|V|W|S|T|L|K|G|\bN)[0-9]/g,""); 
            segmentLists[i].innerHTML = segmentLists[i].innerHTML.replace(/Available fare classes:/,"");
        }
Next, I didn't want the details expanded, but it seems it needs to happen in order for the fare buckets to exist, so I just added a second click.

Code:
    function addCustomSearchResult(jNode) { 
        var divid=jQuery(jNode).attr("href");
        jNode[0].click(); // expand
        //console.debug("done expanding");
        jNode[0].click(); // contract
    }
So, this was a quick and dirty hack to get what I wanted. I made an assumption that the results from getElementsByClassname() calls were going to be identically ordered and correlated. Limited testing seems to indicate that they are. I also didn't spend any time playing around with making the new display pretty. It doesn't look bad, but the existing icons for wifi and what not are moved as a result. I also didn't optimize at all, so you could combine into the existing loop I'm sure.

Also, in the below image, I was playing around with font size and color (100%, Blue) but again, someone with more energy could fiddle around more.


Last edited by superEGO; Jul 27, 2015 at 2:52 pm Reason: fixed regex
superEGO is offline  
Old Jul 27, 2015, 1:01 pm
  #17  
A FlyerTalk Posting Legend
Original Poster
 
Join Date: Apr 2001
Location: PSM
Posts: 69,232
Originally Posted by superEGO
This might be of use to a handful of people.. ...
VERY nice. I like that a lot.

Definitely better IMO to have the data without everything fully expanded. I didn't think to copy it over and collapse the boxes again.

sbm12 is offline  
Old Jul 27, 2015, 1:18 pm
  #18  
 
Join Date: Aug 2005
Location: NRT/HND, IWK, SAT, BWI, NAP, OKA, AUS, DEN, COS and PUB
Programs: UA 1K.. 1MM
Posts: 994
Oops... FYI, I just noticed that I left out FN and J from the line deleting all the useless buckets. Also, never worked on matching N when it's there without a preceding char. And also, might be a good idea to kill all the whitespace left by removal of the buckets.
superEGO is offline  
Old Jul 27, 2015, 2:19 pm
  #19  
 
Join Date: Jan 2013
Location: NYC
Posts: 538
Originally Posted by superEGO
Oops... FYI, I just noticed that I left out FN and J from the line deleting all the useless buckets. Also, never worked on matching N when it's there without a preceding char. And also, might be a good idea to kill all the whitespace left by removal of the buckets.
Here's a regular expression that includes FN and J in the list of useless buckets and attempts to kill N:

Code:
(?:F|A|J|C|D|Z|P|Y|B|M|E|U|H|Q|V|W|S|T|L|K|G)[0-9]|((\s|F|J|Z|Y|H)N[0-9])
st1575 is offline  
Old Jul 27, 2015, 2:50 pm
  #20  
 
Join Date: Aug 2005
Location: NRT/HND, IWK, SAT, BWI, NAP, OKA, AUS, DEN, COS and PUB
Programs: UA 1K.. 1MM
Posts: 994
Originally Posted by st1575
Here's a regular expression that includes FN and J in the list of useless buckets and attempts to kill N:

Code:
(?:F|A|J|C|D|Z|P|Y|B|M|E|U|H|Q|V|W|S|T|L|K|G)[0-9]|((\s|F|J|Z|Y|H)N[0-9])
There isn't any whitespace before the N, so it still wasn't matching. Looks like \b for matching the beginning is the magic:
Code:
(?:F|FN|A|J|JN|C|D|Z|ZN|P|Y|YN|B|M|E|U|H|HN|Q|V|W|S|T|L|K|G|\bN)[0-9]
superEGO is offline  
Old Jul 27, 2015, 3:02 pm
  #21  
 
Join Date: Jan 2013
Location: NYC
Posts: 538
Originally Posted by superEGO
Looks like \b for matching the beginning is the magic:
Excellent magic indeed. ^
st1575 is offline  
Old Jul 27, 2015, 5:01 pm
  #22  
 
Join Date: Aug 2005
Location: NRT/HND, IWK, SAT, BWI, NAP, OKA, AUS, DEN, COS and PUB
Programs: UA 1K.. 1MM
Posts: 994
Okay, spent a few more minutes playing with this and made a few changes:
1) Now copying into 'segment-operator' div. This is pretty often empty and easier to format leaving the wifi and other icons alone.
2) Had to manually format the list since it wasn't inheriting from the advisory list formatting.
3) Some cleanup of the empty list elements and whitespace.


Code:
        var segmentLists = getElementsByClassName(document, 'div','segment-operator');
        for (var i = 0, len = segmentLists.length; i < len; i++) {
            var buckets = cabinLists[i].innerHTML.replace(/(?:F|FN|A|J|JN|C|D|Z|ZN|P|Y|YN|B|M|E|U|H|HN|Q|V|W|S|T|L|K|G|\bN)[0-9]/g,"");
            buckets = buckets.replace(/<li class=\"label\">Available fare classes:<\/li>/,"");
            buckets = buckets.replace(/<li><\/li>\s+/ig,"");
            buckets = buckets.replace(/<li>/ig,"<li style=\"float: left;padding-left: 6px;\">");
            buckets = "<ul style=\"list-style-type: none; margin: auto; padding: inherit;\">" + buckets + "</ul><br/>";
                       
            segmentLists[i].innerHTML = segmentLists[i].innerHTML + buckets;
        }
superEGO is offline  
Old Jul 27, 2015, 6:26 pm
  #23  
A FlyerTalk Posting Legend
Original Poster
 
Join Date: Apr 2001
Location: PSM
Posts: 69,232
New version of the code is now in the Chrome store and available for direct download. More details at http://blog.wandr.me/browser-extensions/ or up above in this thread.

n.b. The link above is to my blog or to one which I am a regular contributor. FT rules require that I disclose that in the post.
sbm12 is offline  
Old Aug 5, 2015, 12:42 pm
  #24  
A FlyerTalk Posting Legend
Original Poster
 
Join Date: Apr 2001
Location: PSM
Posts: 69,232
Originally Posted by sbm12
New version of the code is now in the Chrome store and available for direct download. More details at http://blog.wandr.me/browser-extensions/ or up above in this thread.

n.b. The link above is to my blog or to one which I am a regular contributor. FT rules require that I disclose that in the post.
Some issues cropped up as UA migrated the beta code into a more production-ready state. If you're not running v7.2.0 odds are you'll be very unhappy when you search in the new interface.
sbm12 is offline  
Old Aug 23, 2015, 8:50 am
  #25  
A FlyerTalk Posting Legend
Original Poster
 
Join Date: Apr 2001
Location: PSM
Posts: 69,232
Originally Posted by sbm12
Some issues cropped up as UA migrated the beta code into a more production-ready state. If you're not running v7.2.0 odds are you'll be very unhappy when you search in the new interface.
Ditto, but v7.2.1 is now current. Thanks to fumje for letting me know about the last set of issues.
sbm12 is offline  
Old Sep 4, 2015, 7:59 pm
  #26  
A FlyerTalk Posting Legend
Original Poster
 
Join Date: Apr 2001
Location: PSM
Posts: 69,232
Originally Posted by sbm12
Ditto, but v7.2.1 is now current. Thanks to fumje for letting me know about the last set of issues.
v7.3.3 is now current, adding new features and addressing an issue where booking class would display multiple times in the results.



n.b. The link above is to my blog or to one which I am a regular contributor. FT rules require that I disclose that in the post.
sbm12 is offline  
Old Sep 7, 2015, 3:58 pm
  #27  
 
Join Date: Jan 2000
Location: SMF
Programs: UA 1K MM, AA EXP
Posts: 1,537
Originally Posted by sbm12
v7.3.3 is now current, adding new features and addressing an issue where booking class would display multiple times in the results.
Seth

Thanks for the excellent tools. I am having trouble getting the chrome extension to work on international itineraries with a domestic leg first. Sometimes (but not always) the bracketed fare classes under the price pop up. Meanwhile, the red and green codes never pop up on the main page (i.e. without me selecting "details" being selected individually for each flight).
And sometimes, even when I click on details the fare codes are not colored red or green.

(I am fully logged in and in expert mode, and they seem to routinely work on domestic legs)

Happy to PM you on this but thought that answer may be helpful to others here?

Thanks again for making this available.

Lurker
Lurker is offline  
Old Sep 25, 2015, 4:44 pm
  #28  
Suspended
 
Join Date: Mar 2009
Posts: 981
expert mode script for chrome

got a new laptop (love the new yoga! - and i can keep it open and watching my movie during takeoff and landing because it folds into a tablet). anyway, i searched and cant' find - how do i install the expert mode script?
iflyuaaa is offline  
Old Sep 25, 2015, 6:12 pm
  #29  
 
Join Date: Apr 2012
Location: SFO
Programs: AS MVP Gold 75K, UA Gold, Marriott LTT, Avis President's Club
Posts: 1,539
from the Chrome Web Store

https://chrome.google.com/webstore/d...fmpdpkad?hl=en

You need to have expert mode enables via your .bomb account already.
JHake10 is offline  
Old Sep 26, 2015, 8:16 pm
  #30  
Suspended
 
Join Date: Mar 2009
Posts: 981
Originally Posted by JHake10
from the Chrome Web Store

https://chrome.google.com/webstore/d...fmpdpkad?hl=en

You need to have expert mode enables via your .bomb account already.
awesome, thx! this was way easier then i remembered the last time i had to install it.
iflyuaaa is offline  


Contact Us - Manage Preferences - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service -

This site is owned, operated, and maintained by MH Sub I, LLC dba Internet Brands. Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Designated trademarks are the property of their respective owners.