Results 1 to 11 of 11
Like Tree13Likes
  • 7 Post By Misj'
  • 2 Post By Misj'
  • 3 Post By Misj'
  • 1 Post By Nafetz
  1.    #1  
    Smart URL Cleaner

    Background
    In the first webOS User's Online Meet-up we shortly discussed a browser-patch for the legacy browser to improve its usability. Shuswap indicated that googleweblight helped when visiting sites that cannot otherwise be rendered by the browser. A simple patch was proposed that would add https://googleweblight.com/?lite_url= to the current URL.

    General Description of the Problem
    The legacy webOS browser is not up-to-date when it comes to modern web technologies. This is perfectly understandable. Web-browsing is, however, still one of the main activities on webOS. And in certain cases, all that’s needed to properly visit a website is a simple modification of the URL. Some examples are:
    https://www.youtube.com/watch?v=9pAgJ9x-2IA can be viewed when changing it to youtube.com/v/9pAgJ9x-2IA As of 13-09-2017 Google has stopped serving Flash versions of their video's. As a result, this solution won't work anymore. For an alternative (albeit less simple) work-around see post: #11
    https://twitter.com/webosports works slightly better (or worse depending on your opinion) when you use https://mobile.twitter.com/webosports
    • Etc. etc.

    It is, of course, impossible to implement every single solution (many of which might be an individual preference) or create a pre-made patch for every circumstance.

    The Patch
    Basic Functionality
    Versatility is key when solving the above-mentioned problems. To accommodate this, users can create and modify their own filters specifically for their needs. The Smart URL Cleaner adds a new section/group to the browser’s preferences.


    Each filter consists of a marker, matching pattern, replace pattern, prepend, and append. The first two can be set to either a simple string or a regular expression. The patch will loop through the list of filters until it is able to do something. This means that if the marker matches but the matching pattern does not (and there is no prepend or append defined), the next filter will be tried. But when both match the filter will be executed, and the patch will not continue down the list. The order of the filters is thus relevant, and the user can change these using the arrow buttons.

    Custom filters can be removed by swiping, but pre-installed filters cannot be removed or altered. They can however, be reordered and turned off should the user not wish to use them. Also, you can change the description of custom filters by clicking the description line.

    NOTE: new filters are by default turned off (until you manually turn them on).
    NOTE2: You can change the description of custom filters by clicking the description line.

    A button is added to the action-bar of the browser:

    Pressing this button will execute the url-filters.

    Additional Functionality
    The basic features are turned on by default. However, additional functionality can be controlled via the Tweaks application:


    First and foremost, a quick Javascript toggle (to turn it on and off) can be added to the browser’s action bar. Since certain sites work better with Javascript off, while others prefer Javascript on, this toggle lets you change the browser (wide) setting on the fly.
    On Off

    Another feature if the auto-clean. When turned off the patch will guess whether the content of the address-bar is a valid URL; in which case it will automatically run the filters on-enter. However, the guess might not always be correct resulting in unintentional behavior. The auto-clean feature is not generally advised. It might, however, be useful or preferred by some (especially since it allows you to free up some space on the action bar by hiding the smart-clean button).

    Compatible Devices
    Currently the patch was developed only for the touchpad (mostly because I don’t have a phone to develop for and test on, and also because it would require a slightly different UI-approach).

    Known Issues
    None.
    Please report in this thread.

    Incompatible Patches
    Please report in this thread.

    Examples of Custom Filters

    Description: Twitter to Mobile
    Marker //twitter.com/ (string)
    Match //twitter.com/ (string)
    Replace //mobile.twitter.com/
    Description: Twitter deMobilize
    Marker mobile.twitter.com/ (string)
    Match mobile. (string)
    Replace (empty string)
    Description: NYTimes
    Marker www.nytimes.com (string)
    Match www. (string)
    Replace mobile.

    Useful Custom Filters
    Please share if you found any useful custom filters.

    Files & Installation
    browser-smart-url-cleaner.patch
    ca.canucksoftware.patches.browser-smart-url-cleaner.json

    The JSON file is only needed if you want to set-up the additional functionality through Tweaks.
    The patch can be installed via Internalz Pro (or WOSQI). The JSON can be added to Tweaks by copying it to /media/cryptofs/apps/usr/palm/services/org.webosinternals.tweaks.prefs/preferences
    Last edited by Misj'; 09/14/2017 at 11:19 AM.
    Nafetz, gazaud, Mutoidi and 4 others like this.
  2. #2  
    Wow! Nice work! I wish I had a touchpad to try it out on. Will there be a Pre3 version?

    Sent from my Passport using Forum Fiend OSP v1.3.3.
    IIIxe | z22 | Pre 3 | Bold 9900 | Q10 | Nexus 4
  3. #3  
    I haven't tried it yet, but this looks very comprehensive! It's almost an app in itself!
    I'll have to get my head around the filter construction. Hopefully a few suggestions will be posted here and I hope someone can make a version for phones.

    I'll add this to the service pack list. I should add QupZilla too I suppose!

    One quibble:
    Quote Originally Posted by Misj' View Post
    The patch can be installed via Preware (e.g. by opening it in Internalz Pro).
    I'm no expert, but I think I'm right in saying that patch files can be installed with WOSQI or Internalz Pro. For Preware to install a patch requires that is is packaged as an ipkg, so I think your sentence should mention Mr Robitaille's apps and not mention Preware.
    [How-to] Installing .patch files on your phone or Touchpad
  4.    #4  
    Quote Originally Posted by Preemptive View Post
    I'm no expert, but I think I'm right in saying that patch files can be installed with WOSQI or Internalz Pro
    That's what I get from combining three sentences in my head and changing them on the fly without re-reading the end-result - Wanted to say that the patch isn't in any Preware feed (yet), and that I advice Internalz Pro for installation. Changed the original post accordingly.

    Quote Originally Posted by Shuswap View Post
    Will there be a Pre3 version?
    Since I don't have a webOS phone it'll take a bit more time to develop it. I'll probably be able to lend one, but the phone is currently on vacation for the next two weeks. The goal is to create a second patch with similar functionality for the Pre3 (and possibly other phones as well).
    Preemptive and Shuswap like this.
  5.    #5  
    Quote Originally Posted by Preemptive View Post
    I'll have to get my head around the filter construction.
    The basic concept is quite simple:
    - Marker is the identifying marker in the URL which tells the patch that we might have to do something
    - Match is the search criteria of the part of the URL we want to change
    - Replace is what we want to turn Match into.

    The patch iterates through all filters until it is able to do something. That means: if both the Marker match and the Match match then the patch knows that we a. have a URL that is eligible for filtering, and b. the filter can also be applied. When either fail, the patch continues to the next possible filter. If both succeed the patch applies the filter and stops further processing (hence the relevance of the filter-order).

    In many cases you can use simple Markers, Matches, and Replaces, e.g. if you want to turn a specific and known piece of the URL into something else.However, for complex URL's you will probably need to resort to Regular Expressions (and their inherent complexity). Looking at the pre-installed filters and turning them on-and-off will probably help to get your head around them.


    Note: things are a little different with Prepend and Append since those don't rely on Match and only on Marker. If the Marker matches then its Prepend and Append will be applied and the filter was successful.
  6. #6  
    Thank you very much for this great patch. What I like most is the Javascript button. I wanted to have this for years and couldn't make it myself.
    It would be cool to have the possibility to auto enable Javascript only if the url matches a marker in the settings.
    But hey - it's already amazing!
    Misj' likes this.
  7.    #7  
    Quote Originally Posted by Nafetz View Post
    It would be cool to have the possibility to auto enable Javascript only if the url matches a marker in the settings.
    I thought about that too, but the problem is that the JavaScript-toggle is browser-wide and not site-wide. So adding it to the (site specific) filter could become counter-intuitive if you have multiples sites/cards open.

    Having it as a manual toggle-button, therefore, felt more logical; as you actively set it to what you need for your current activity. And since pressing the button will also directly reload the page in the card you pressed it in, you still get quite a smooth experience.
  8. #8  
    thank you for your work it will be very useful, I hope to pre3
  9.    #9  
    This morning I noticed that Google finally fully dropped flash support for youtube. Which mean that the aforementioned URL trick doesn't work anymore. It was a matter of time until this would happen, but I had hoped it would be a few years longer.
  10. #10  
    Quote Originally Posted by Misj' View Post
    This morning I noticed that Google finally fully dropped flash support for youtube. Which mean that the aforementioned URL trick doesn't work anymore. It was a matter of time until this would happen, but I had hoped it would be a few years longer.
    Oh, no! After all the work you put in!

    However, this still improves other sites and we have LuneTube for youtube.

    Ah.. now I have another thought for the User Group. Too many ideas..!
  11.    #11  
    Quote Originally Posted by Preemptive View Post
    Oh, no! After all the work you put in!
    However, this still improves other sites and we have LuneTube for youtube.
    Yeah...it kinda sucked. On the other hand it does mean that I might want to expand the patch with an optional app-launcher to open the link directly in LuneTube.

    That being said, the great thing about the patch is that it's specifically made to be versatile. So as a test I created the following two filters:

    Description: Youtube to Download
    Marker www.youtube. (string)
    Match .youtube. (string)
    Replace .vdyoutube.
    Description: Download to Youtube
    Marker www.vdyoutube. (string)
    Match vdyoutube. (string)
    Replace youtube.

    This will open a download page for the movie, and if you tap the red button and select one of the mp4's (not the ones with the rectangle as they don't have any sound), they will stream and open in the webOS media player. It's not a one-click solution but it is a solution none-the-less. (I notices LuneTube has some problems with very long movies (4 hour+ long), so this is just as an alternative).

    NOTE: I say nothing about the legality of using this site. The user-agreement states that you are not allowed to download youtube movies only stream. But strictly speaking that's what we're doing as they stream to the webOS media-player.

    EDIT: this solution doesn't work with every video (e.g. the Daily Show won't work); but that's unrelated to webOS as they are forbidden on my desktop as well. Then again, the flash-solution didn't work for all videos either.
    Last edited by Misj'; 09/14/2017 at 11:04 AM.

Similar Threads

  1. Streaming on Touchpad? (Netflix, Hulu, Etc)
    By racingfreak92 in forum HP TouchPad
    Replies: 5
    Last Post: 08/28/2017, 07:07 PM
  2. RIP 1 of my TouchPads (flash death?)
    By eblade in forum HP TouchPad
    Replies: 0
    Last Post: 07/20/2017, 11:51 AM
  3. Tocuhpad browser certificate error
    By reggieb in forum HP TouchPad
    Replies: 2
    Last Post: 07/05/2017, 09:23 PM
  4. webOS Doctor 3.0.4 and 3.0.3 for Touchpad Go AT&T
    By darkdeveloper in forum Other webOS Tablets
    Replies: 1
    Last Post: 07/04/2017, 01:50 PM
  5. Replies: 2
    Last Post: 06/29/2017, 06:57 PM

Posting Permissions