html
16 TopicsHow to target only webview rendering with CSS?
This particular page displays correctly on desktop and mobile Firefox browsers, Mac and iOS browsers, Edge, Chrome, and Chromium. But when it's seen through web view—that is, from a link on the Android Facebook app or even the actual Android app, Duck Duck Go—one of the font sizes is bigger and extends beyond its container div, obstructing the view. Visit Here for more information on solving problems:Prodigit After ten years of front-end development, I haven't yet looked at web view customizations. How can I use CSS (or JavaScript if necessary) to target web view rendering?57Views0likes1CommentAppDynamics EUM JavaScript Injection for Selective URLs
Problem this snippet solves: This code allows for the adrum.js agent to be dynamically injected into an application to support collecting EUM metrics. With this code, you can select from any number of HTTP Request headers and/or POST parameters. Additional EUM features in use: Custom GeoIP mappings based on a DataGroup User Data for Browser Snapshots, currently APM SID and Username How to use this snippet: This sample iRule assumes that the TCL variables $username and $sid have been previously created to support the UserData injection. If you don't have this information or APM available then these lines should be commented out or changed to meet your needs. Import the ltm profiles and iRule via tmsh load sys config merge <from-terminal> On your virtual, attache the Head-HTML profile as well as the iRule. Code : LTM Profiles Required: ltm html-rule tag-raise-event HTMLEvent-HeadStart-HTMLRule { description "Match an HTML tag for " match { tag-name head } } ltm profile html Head-HTML { app-service none content-detection disabled content-selection { text/html text/xhtml } defaults-from html description none rules { HTMLEvent-HeadStart-HTMLRule } } iRule to be attached to the Virtual: ltm rule SND-AppDynamics-HTML-Rule { when CLIENT_ACCEPTED { set APPDYNAMICS_EUM_DEBUG 0; } when HTTP_REQUEST { set APPDYNAMICS_EUM_APP_ID "AD-xxx-xxx-xxx-xxx" if { $APPDYNAMICS_EUM_DEBUG > 0 } {set uri [HTTP::uri]} if {[HTTP::uri] starts_with "/my/HomePage.do"} { # set enableEum 1 if { [HTTP::header Content-Type] eq "application/x-www-form-urlencoded" } { # HTTP::collect [HTTP::header Content-Length] # Only collect the first 200 bytes which should be enough to capture eventSource HTTP::collect 200 } else { if {[HTTP::uri] starts_with "/my/defaultPage"} { set enableEum 1 } } } elseif {[HTTP::uri] starts_with "/app1"} { set enableEum 1 } elseif {[HTTP::uri] starts_with "/app2"} { set enableEum 1 } when HTTP_REQUEST_DATA { set namevals [split [HTTP::payload] "&"] for {set i 0} {$i < [llength $namevals]} {incr i} { set params [split [lindex $namevals $i] "="] # log local0. " [lindex $params 0] : [lindex $params 1]" if {[lindex $params 0] equals "eventSource"} { switch -glob [lindex $params 1] { "PostParm1" - "PostParm2" - "PostParm3" { set enableEum 1 if { $APPDYNAMICS_EUM_DEBUG > 0 } { log local0. "FOUND HTTP DATA [lindex $params 1] TO ENABLE APPDYNAMICS EUM"; } } } break; } unset params } unset namevals } when HTTP_RESPONSE { if {[info exists enableEum]} { if { ($enableEum == 1) && ([HTTP::header "Content-Type"] starts_with "text/html") } { HTML::enable set enableEum 0 } else { HTML::disable } } else { HTML::disable } } when HTML_TAG_MATCHED { if { $APPDYNAMICS_EUM_DEBUG > 0 } { log local0. "uri = $uri element = [HTML::tag name] attribute id = [HTML::tag attribute id]"} switch [HTML::tag name] { "head" { if { $APPDYNAMICS_EUM_DEBUG > 0 } { log local0. "$uri info username [info exists username] info sid [info exists sid]"} if {([info exists username]) && ([info exists sid])} { # Send custom GeoIP Data to with the adrum beacon if we are on the private network set geoData [split [class match -value [IP::client_addr] equals Branch-Address-DataGroup ] "/"] if { $geoData != "" } { HTML::tag append [subst { window\["adrum-app-key"\] = "$APPDYNAMICS_EUM_APP_ID"; window\["adrum-start-time"\] = new Date().getTime(); window\["adrum-geo-resolver-url"\] = "thisdoesnotmatter"; window\["adrum-config"\] = { geo: { "country": "United States", "region": "[lindex $geoData 0]", "city": "[lindex $geoData 1]", "localIP": "[IP::client_addr]" } }; if (ADRUM) { ADRUM.command ("addUserData", "User", "$username"); } { ADRUM.command ("addUserData", "LastMRH_Session", "$sid"); } } ] } else { HTML::tag append [subst { window\["adrum-app-key"\] = "$APPDYNAMICS_EUM_APP_ID"; window\["adrum-start-time"\] = new Date().getTime(); if (ADRUM) { ADRUM.command ("addUserData", "User", "$username"); } { ADRUM.command ("addUserData", "LastMRH_Session", "$sid"); } } ] } unset geoData } } } } } Tested this on version: 11.5649Views0likes0CommentsMaintenance page using iFiles
Hi, I'm trying to setup a maintenance page using iFiles. I have gone through the below link and configured iFiles, iFiles List and created an irule as mentioned below, https://devcentral.f5.com/articles/v111-ndashexternal-file-access-from-irules-via-ifiles iRule: when HTTP_REQUEST { if { [HTTP::uri] eq "/" } { HTTP::respond 200 content [ifile get api_asia_html] } else { discard } } However, after attaching the above iRule I cannot access the virtual server as it gets timed out. Not sure if I'm missing something in my irule, which calls an html page with images already embedded. Can anyone please verify my irule and let me know what I'm missing, so that anyone accessing this virtual server should see maintenance window page. Thanks in advance, MSKSolved1.1KViews0likes10CommentsSending HTML Emails via APM Email Action
Hi All, Is it possible at all to send HTML emails (so to include an image in the email body) via the APM policy by default. I see a few threads from years gone by where people were asking for this, but no solid answers. Alternatively, without having the write out the entire SMTP conversation and instead leveraging the email options on F5, is it possible to iRule this in it's simplest form? Many thanks, JDSolved1.4KViews0likes3CommentsWss traffic not going through when html profile in use
Hi Team Hope everyone is doing well. I have a setup of F5 asm n f5 ltm and application uses wss protocol after initial login. I am using html profile n stream profile to manipulate the html contents of html page. And when using ltm alone with just wss profile and asm, everything is working but when I add the html profile where I have chose to remove some of the tags and stream to replace some of the strings, but we do want to apply asm on the wss content as well, so dnt want to remove http profile when wss upgrade header is seen. And I did try applying html profile to the login page alone by fetching the uri from request and checking it in response but for some reason, after login where wss protocol upgrade takes place, the application doesn't work.269Views0likes0CommentsRemove the Select Client popup from VMware Horizon iApp
Due to security controls, we must have all users use web based HTML (BLAST) access to VDI sessions. The iApp works great, except when you launch a desktop it show a popup to requesting the user select a client (either VMware Horizon or HTML5 Client). I have gone though the iApp template () and cannot find any reference to the popup. I have looked through the APM policy, session-policy and Webtops to see if it there, but I can't seem to find it. Any ideas how to disable this popup?453Views0likes1CommentSelective Compression on BIG-IP
BIG-IP provides Local Traffic Policies that simplify the way in which you can manage traffic associated with a virtual server. You can associate a BIG-IP local traffic policy to support selective compression for types of content that can benefit from compression, like HTML, XML, and CSS stylesheets. These file types can realize performance improvements, especially across slow connections, by compressing them. You can easily configure your BIG-IP system to use a simple Local Traffic Policy that selectively compresses these file types. In order to use a policy, you will want to create and configure a draft policy, publish that policy, and then associate the policy with a virtual server in BIG-IP v12. Alright, let’s log into a BIG-IP The first thing you’ll need to do is create a draft policy. On the main menu select Local Traffic>Policies>Policy List and then the Create or + button. This takes us to the create policy config screen. We’ll name the policy SelectiveCompression, add a description like ‘This policy compresses file types,’ and we’ll leave the Strategy as the default of Execute First matching rule. This is so the policy uses the first rule that matches the request. Click Create Policy which saves the policy to the policies list. When saved, the Rules search field appears but has no rules. Click Create under Rules. This brings us to the Rules General Properties area of the policy. We’ll give this rule a name (CompressFiles) and then the first settings we need to configure are the conditions that need to match the request. Click the + button to associate file types. We know that the files for compression are comprised of specific file types associated with a content type HTTP Header. We choose HTTP Header and select Content-Type in the Named field. Select ‘begins with’ next and type ‘text/’ for the condition and compress at the ‘response’ time. We’ll add another condition to manage CPU usage effectively. So we click CPU Usage from the list with a duration of 1 minute with a conditional operator of ‘less than or equal to’ 5 as the usage level at response time. Next under Do the following, click the create + button to create a new action when those conditions are met. Here, we’ll enable compression at the response time. Click Save. Now the draft policy screen appears with the General Properties and a list of rules. Here we want to click Save Draft. Now we need to publish the draft policy and associate it with a virtual server. Select the policy and click Publish. Next, on the main menu click Local Traffic>Virtual Servers>Virtual Server List and click the name of the virtual server you’d like to associate for the policy. On the menu bar click Resources and for Policies click Manage. Move SelectiveCompression to the Enabled list and click Finished. The SelectiveCompression policy is now listed in the policies list which is now associated with the chosen virtual server. The virtual server with the SelectiveCompression Local Traffic Policy will compress the file types you specified. Congrats! You’ve now added a local traffic policy for selective compression! You can also watch the full video demo thanks to our TechPubs team. ps984Views0likes7CommentsiRule to Change HTML "Name" Attribute in VPE
I am attempting to have an iRule that will change the HTML while in the VPE. We have an application that uses SAML and is looking for the "name" attribute to be "user," but our SAML IdP's name attribute is "username." This is important because the application allows credential caching, but it is hard coded to only allow caching for that specific value. I've been reading up on the STREAM expression to do this, but can't seem to figure out how to have the F5 do it since it is redirecting to the IdP. We were able to do this with IIS, but would rather have the F5 handle it. The other thought was to create a custom login screen on the F5 that would have the name attribute set correctly, but I can't figure out how to post to our ADFS SAML IdP. Update: I've been looking into the STREAM expressions, but apparently those have a bug when being used by APM as described in https://support.f5.com/csp/article/K12558. It doesn't appear that we have LTM installed on the same machine as APM because we don't have the option for "Host" in the destination box. When I log into the local (non-DMZ) LTM, it does have that option available. I've also tried using HTML_TAG_MATCHED, but it appears to only trigger the iRule AFTER the submit button is clicked on the form. From the documentation, it doesn't sound like that should be the way it happens - the example shows replacing jpg images with png, so it would need to happen on page load unless I am misunderstanding it. https://devcentral.f5.com/wiki/iRules.HTML-tag-attribute.ashx https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-concepts-11-4-0/9.html Thanks!281Views0likes1Comment