Applies
to:
Working with BrowserBob
BrowserBob applications can react to content
in specific ways, using the scanning functionality. It's a way to react
to the loading of specific URL's or contained (key-) words. By that means
the application can monitor the URL (or path), the browser status messages
(fired when a page is loaded), or the page title of a document and react
to certain keywords (strings) with any BrowserBob action or chain of actions
(actionlist).
Redirect URL's, block access & more:
Using this feature you can scan for a certain URL for example and redirect
the loading to a new web window or block access to the website. You can
deliver additional information from a database, based on scanning accessed
content.
Control your application by scanning:
You can use scanning in order to show specific content in a specific functional
environment. React to certain keywords, send commands to your application
by customized loading status messages in your html and much more.
An example would be to scan for a certain
file-type, like an mpg video and redirect the opening of it to a specifically
designed player interface. There's even more to it, as you can combine
this functionality with more logic, and display additional information
from a database for example.
Scanning is also useful for controlling your
application in various ways. If you are dealing with your own content
you can create specific page names, page titles,
folder structures and browser status messages, which allow you to identify
and react to your content.
Using scanning in combination with action lists, you can invoke a list
of actions to be executed dependent on a scanning process.
In detail you can scan for strings in the following info:
- URL - "webaddress",
webpage, which may as well be a local path...
- Title - page title of a webpage,
html-page (document displayed or executed in a web window).
- Status - content of the loading status of
the browser (down left in a standard browser, where the page loading status
is shown).
Detailed specifications your choice of options
when setting up a
scanning process:
Scanning reference
How
scanning works:
For any BrowserBob web object (Main web, Web1, ...) you can define an unlimited
number of scans. The defined scanning source (URL, title, browser status)
will be constantly monitored for the strings you specify in field Scan
- if they match, the action specified under Action is performed
on the specified target object.
Open the Scanning
window via the View menu. Make sure the concerned web object is highlighted
when you open the scanning window. Scanning only works for web objects
and the scanning window will only display scanning processes of the selected
web object.
|
|
Example
1:
In this example a button has been assigned a local link. Clicking the button
will load the local html-page loading_catalog.html
We want to display this page in a dedicated, changed interface (state)
- that's why we use the scanning procedure: to invoke a state change (user
interface change on the fly) without further user action, we scan for
the local path to the loaded html-page:
<_currentdir_>\Additional\loading_catalog.html
Source is "URL" -
even if it's a local path.
Target is "Main Dialog" - the main dialog should perform
a state change.
Action is "State change" - this action needs as
parameter specification the name of the state to change to - in our example
this is a state named "catalog".
|
|
 |
Example 2:
We want to scan Main Web for the string "google", using the Fuzzy functionality, so the scan will
result in an action as soon as the URL contains the string "google"
anywhere.
Target is a web object, called "Web1" in our example
Action is Navigate to Target - load a specific URL.
Parameter the
parameter required by action "Navigate to target" is
the target URL, which should be loaded in the target object (Web1). In
our example this is a variable, as we want to move the URL of Main Web
to Web1,
before the google page is opened.
Variable <_Main Web.URL_> contains the
URL which was shown in "Main Web", before the
new URL request triggered the scanning process and the action.
|
|
 |
What
exactly happens via this scan:
Scanning has been implemented for "Main Web" here. The scanning
process gets a positive result as soon as a new URL containing the string
"google" is entered. The URL shown in Main Web before this process,
is moved
to "Web1" (via the variable) and the URL containing the "google"
string is loaded in "Main Web" as entered.
... a powerful tool for creating interactive web applications with amazing
effects...
Example 3: scanning for customized browser
status messages
The application can react to specific browser loading status messages like
"ready" or the ones you foresee in your html pages, by using
JavaScript commands sending status messages to the application.
If you are dealing with your own content, you can create special status
messages in order to trigger application behaviour via scanning. The following
example shows you what to enter into an html page, if you want to send
a status message to the application as soon as the mouse is moved over
a link:
<html><head><title>Test</title>
</head><body>
<a href="Examplelink.htm" onmouseover="status='This is
a special link';return true;">Link with special status message</a>
</body></html>
If you create a
scanning process now, which investigates the browser status for the string
"This is a special link" or just the word "special"
with "Fuzzy" enabled, the connected action will be executed
as soon as the user moves the mouse over this link.
|
|
|
Example
4: using the <_scan_> variable
You want to open specific content in a seperate
web on your main dialog, like forwarding links from main web to a different
web with a specific interface for example. Let's say you scan MainWeb
for "mypopup" with fuzzy enabled,
so it will react to a user clicking on a link to "/allpopups/mypopup1.html".
You want to show the content in Web1 instead of the MainWeb. In order to
make this happen, you simply choose "URL and Cancel" under Source and choose "Web1" in the
Target field, Action
would be Navigate to target and parameter
<_Scan_> (use the parameter selection
button for choosing). The parameter scan returns the FULL value of the
investigated URL, which would be "http://www.yourdomain.com/allpopups/mypopup1.html".
Consequently, the URL would be opened in Web1 now, MainWeb would stay the
same. |
|
|
|
|
|
|
|
|
|
|
|