# eric6.Helpviewer.HelpBrowserWV

Module implementing the helpbrowser using QWebView.

### Global Attributes

None

### Classes

HelpBrowser | Class implementing the helpbrowser widget.
HelpWebPage | Class implementing an enhanced web page.
JavaScriptEricObject | Class implementing an external javascript object to search via the startpage.
JavaScriptExternalObject | Class implementing an external javascript object to add search providers.
LinkedResource | Class defining a data structure for linked resources.

### Functions

contentSniff | Module function to do some content sniffing to check, if the data is HTML.

## HelpBrowser

Class implementing the helpbrowser widget.

This is a subclass of the Qt QWebView to implement an interface compatible with the QTextBrowser based variant.

### Signals

backwardAvailable(bool)
  emitted after the current URL has changed
forwardAvailable(bool)
  emitted after the current URL has changed
highlighted(str)
  emitted, when the mouse hovers over a link
search(QUrl)
  emitted, when a search is requested
sourceChanged(QUrl)
  emitted after the current URL has changed
zoomValueChanged(int)
  emitted to signal a change of the zoom value

### Derived from

QWebView

### Class Attributes

ZoomLevelDefault
ZoomLevels

### Class Methods

None

### Methods

HelpBrowser | Constructor
__accessKeyShortcut | Private slot to switch the display of access keys.
__addExternalBinding | Private slot to add javascript bindings for adding search providers.
__addSearchEngine | Private slot to add a new search engine.
__addSpeedDial | Private slot to add a new speed dial.
__applyZoom | Private slot to apply the current zoom factor.
__blockImage | Private slot to add a block rule for an image URL.
__bookmarkLink | Private slot to bookmark a link via the context menu.
__checkForAccessKey | Private method to check the existence of an access key and activate the corresponding link.
__configureSpeedDial | Private slot to configure the speed dial.
__copyImage | Private slot to copy an image to the clipboard.
__copyLink | Private slot to copy a link to the clipboard.
__copyLocation | Private slot to copy an image or media location to the clipboard.
__currentEngineChanged | Private slot to track a change of the current search engine.
__dataString | Private method to generate a formatted data string.
__databaseQuotaExceeded | Private slot to handle the case, where the database quota is exceeded.
__downloadImage | Private slot to download an image and save it to disk.
__downloadLink | Private slot to download a link and save it to disk.
__downloadMedia | Private slot to download a media and save it to disk.
__downloadRequested | Private slot to handle a download request.
__featurePermissionRequested | Private slot handling a feature permission request.
__generatePrintPreviewClickedFrame | Private slot to generate a print preview of the clicked frame.
__hideAccessKeys | Private slot to hide the access key labels.
__isMediaElement | Private method to check, if the given element is a media element.
__isUrlValid | Private method to check a URL for validity.
__levelForZoom | Private method determining the zoom level index given a zoom factor.
__linkHovered | Private slot to handle the linkHovered signal.
__loadClickedFrame | Private slot to load the selected frame only.
__loadFinished | Private method to handle the loadFinished signal.
__loadProgress | Private method to handle the loadProgress signal.
__loadStarted | Private method to handle the loadStarted signal.
__makeAccessLabel | Private method to generate the access label for an element.
__muteMedia | Private slot to (un)mute the selected media.
__openLinkInNewTab | Private method called by the context menu to open a link in a new window.
__pauseMedia | Private slot to pause or play the selected media.
__printClickedFrame | Private slot to print the selected frame.
__printPdfClickedFrame | Private slot to print the selected frame to PDF.
__printPreviewClickedFrame | Private slot to show a print preview of the clicked frame.
__reloadAllSpeedDials | Private slot to reload all speed dials.
__resetSpeedDials | Private slot to reset all speed dials to the default pages.
__searchRequested | Private slot to search for some text with a selected search engine.
__sendLink | Private slot to send a link via email.
__showAccessKeys | Private method to show the access key labels.
__showClickedFrameSource | Private slot to show the source of the clicked frame.
__statusBarMessage | Private slot to handle the statusBarMessage signal.
__unsupportedContent | Private slot to handle the unsupportedContent signal.
__urlChanged | Private slot to handle the urlChanged signal.
__virusTotal | Private slot to scan the selected URL with VirusTotal.
__webInspector | Private slot to show the web inspector window.
__zoomInClickedFrame | Private slot to zoom into the clicked frame.
__zoomOutClickedFrame | Private slot to zoom out of the clicked frame.
__zoomResetClickedFrame | Private slot to reset the zoom factor of the clicked frame.
addBookmark | Public slot to bookmark the current page.
backward | Public slot to move backwards in history.
checkRSS | Public method to check, if the loaded page contains feed links.
clearHistory | Public slot to clear the history.
closeWebInspector | Public slot to close the web inspector.
contextMenuEvent | Protected method called to create a context menu.
copy | Public slot to copy the selected text.
createWindow | Public method called, when a new window should be created.
documentTitle | Public method to return the title of the loaded page.
dragEnterEvent | Protected method called by a drag enter event.
dragMoveEvent | Protected method called by a drag move event.
dropEvent | Protected method called by a drop event.
event | Public method handling events.
findNextPrev | Public slot to find the next occurrence of a text.
focusOutEvent | Protected method called by a focus out event.
forward | Public slot to move forward in history.
gestureEvent | Protected method handling gesture events.
getRSS | Public method to get the extracted RSS feeds.
hasRSS | Public method to check, if the loaded page has RSS links.
hasSelection | Public method to determine, if there is some text selected.
home | Public slot to move to the first page loaded.
isBackwardAvailable | Public method to determine, if a backwards move in history is possible.
isForwardAvailable | Public method to determine, if a forward move in history is possible.
isLoading | Public method to get the loading state.
keyPressEvent | Protected method called by a key press.
keyReleaseEvent | Protected method called by a key release.
linkedResources | Public method to extract linked resources.
mousePressEvent | Protected method called by a mouse press event.
mouseReleaseEvent | Protected method called by a mouse release event.
preferencesChanged | Public method to indicate a change of the settings.
progress | Public method to get the load progress.
reload | Public slot to reload the current page.
saveAs | Public method to save the current page to a file.
setSource | Public method used to set the source to be displayed.
setZoomValue | Public method to set the zoom value.
source | Public method to return the URL of the loaded page.
wheelEvent | Protected method to handle wheel events.
zoomIn | Public slot to zoom into the page.
zoomOut | Public slot to zoom out of the page.
zoomReset | Public method to reset the zoom factor.
zoomValue | Public method to get the current zoom value.

### Static Methods

None

#### HelpBrowser (Constructor)

HelpBrowser(mainWindow, parent=None, name="")

Constructor

mainWindow
  reference to the main window (HelpWindow)
parent
  parent widget of this window (QWidget)
name
  name of this window (string)

#### HelpBrowser.__accessKeyShortcut

__accessKeyShortcut()

Private slot to switch the display of access keys.

#### HelpBrowser.__addExternalBinding

__addExternalBinding(frame=None)

Private slot to add javascript bindings for adding search providers.

frame (QWebFrame)
  reference to the web frame

#### HelpBrowser.__addSearchEngine

__addSearchEngine(act)

Private slot to add a new search engine.

act (QAction)
  reference to the action that triggered

#### HelpBrowser.__addSpeedDial

__addSpeedDial()

Private slot to add a new speed dial.

#### HelpBrowser.__applyZoom

__applyZoom()

Private slot to apply the current zoom factor.

#### HelpBrowser.__blockImage

__blockImage(act)

Private slot to add a block rule for an image URL.

act (QAction)
  reference to the action that triggered

#### HelpBrowser.__bookmarkLink

__bookmarkLink(act)

Private slot to bookmark a link via the context menu.

act (QAction)
  reference to the action that triggered

#### HelpBrowser.__checkForAccessKey

__checkForAccessKey(evt)

Private method to check the existence of an access key and activate the corresponding link.

evt
  reference to the key event (QKeyEvent)

Returns:
  flag indicating, if the event was handled (boolean)

#### HelpBrowser.__configureSpeedDial

__configureSpeedDial()

Private slot to configure the speed dial.

#### HelpBrowser.__copyImage

__copyImage()

Private slot to copy an image to the clipboard.

#### HelpBrowser.__copyLink

__copyLink()

Private slot to copy a link to the clipboard.

#### HelpBrowser.__copyLocation

__copyLocation(act)

Private slot to copy an image or media location to the clipboard.

act (QAction)
  reference to the action that triggered

#### HelpBrowser.__currentEngineChanged

__currentEngineChanged()

Private slot to track a change of the current search engine.

#### HelpBrowser.__dataString

__dataString(size)

Private method to generate a formatted data string.

size
  size to be formatted (integer)

Returns:
  formatted data string (string)

#### HelpBrowser.__databaseQuotaExceeded

__databaseQuotaExceeded(frame, databaseName)

Private slot to handle the case, where the database quota is exceeded.

frame
  reference to the frame (QWebFrame)
databaseName
  name of the web database (string)

#### HelpBrowser.__downloadImage

__downloadImage()

Private slot to download an image and save it to disk.

#### HelpBrowser.__downloadLink

__downloadLink()

Private slot to download a link and save it to disk.

#### HelpBrowser.__downloadMedia

__downloadMedia(act)

Private slot to download a media and save it to disk.

act (QAction)
  reference to the action that triggered

#### HelpBrowser.__downloadRequested

__downloadRequested(request)

Private slot to handle a download request.

request
  reference to the request object (QNetworkRequest)

#### HelpBrowser.__featurePermissionRequested

__featurePermissionRequested(frame, feature)

Private slot handling a feature permission request.

frame (QWebFrame)
  frame sending the request
feature (QWebPage.Feature)
  requested feature

#### HelpBrowser.__generatePrintPreviewClickedFrame

__generatePrintPreviewClickedFrame(printer)

Private slot to generate a print preview of the clicked frame.

printer
  reference to the printer object (QPrinter)

#### HelpBrowser.__hideAccessKeys

__hideAccessKeys()

Private slot to hide the access key labels.

#### HelpBrowser.__isMediaElement

__isMediaElement(element)

Private method to check, if the given element is a media element.

element
  element to be checked (QWebElement)

Returns:
  flag indicating a media element (boolean)

#### HelpBrowser.__isUrlValid

__isUrlValid(url)

Private method to check a URL for validity.

url
  URL to be checked (QUrl)

Returns:
  flag indicating a valid URL (boolean)

#### HelpBrowser.__levelForZoom

__levelForZoom(zoom)

Private method determining the zoom level index given a zoom factor.

zoom
  zoom factor (integer)

Returns:
  index of zoom factor (integer)

#### HelpBrowser.__linkHovered

__linkHovered(link, title, textContent)

Private slot to handle the linkHovered signal.

link
  the URL of the link (string)
title
  the link title (string)
textContent
  text content of the link (string)

#### HelpBrowser.__loadClickedFrame

__loadClickedFrame()

Private slot to load the selected frame only.

#### HelpBrowser.__loadFinished

__loadFinished(ok)

Private method to handle the loadFinished signal.

ok
  flag indicating the result (boolean)

#### HelpBrowser.__loadProgress

__loadProgress(progress)

Private method to handle the loadProgress signal.

progress
  progress value (integer)

#### HelpBrowser.__loadStarted

__loadStarted()

Private method to handle the loadStarted signal.

#### HelpBrowser.__makeAccessLabel

__makeAccessLabel(accessKey, element)

Private method to generate the access label for an element.

accessKey
  access key to generate the label for (str)
element
  reference to the web element to create the label for (QWebElement)

#### HelpBrowser.__muteMedia

__muteMedia()

Private slot to (un)mute the selected media.

#### HelpBrowser.__openLinkInNewTab

__openLinkInNewTab(act)

Private method called by the context menu to open a link in a new window.

act (QAction)
  reference to the action that triggered

#### HelpBrowser.__pauseMedia

__pauseMedia()

Private slot to pause or play the selected media.

#### HelpBrowser.__printClickedFrame

__printClickedFrame()

Private slot to print the selected frame.

#### HelpBrowser.__printPdfClickedFrame

__printPdfClickedFrame()

Private slot to print the selected frame to PDF.

#### HelpBrowser.__printPreviewClickedFrame

__printPreviewClickedFrame()

Private slot to show a print preview of the clicked frame.

#### HelpBrowser.__reloadAllSpeedDials

__reloadAllSpeedDials()

Private slot to reload all speed dials.

#### HelpBrowser.__resetSpeedDials

__resetSpeedDials()

Private slot to reset all speed dials to the default pages.

#### HelpBrowser.__searchRequested

__searchRequested(act)

Private slot to search for some text with a selected search engine.

act
  reference to the action that triggered this slot (QAction)

#### HelpBrowser.__sendLink

__sendLink(act)

Private slot to send a link via email.

act (QAction)
  reference to the action that triggered

#### HelpBrowser.__showAccessKeys

__showAccessKeys()

Private method to show the access key labels.

#### HelpBrowser.__showClickedFrameSource

__showClickedFrameSource()

Private slot to show the source of the clicked frame.

#### HelpBrowser.__statusBarMessage

__statusBarMessage(text)

Private slot to handle the statusBarMessage signal.

text
  text to be shown in the status bar (string)

#### HelpBrowser.__unsupportedContent

__unsupportedContent(reply, requestFilename=None, download=False)

Private slot to handle the unsupportedContent signal.

reply
  reference to the reply object (QNetworkReply)
requestFilename=
  indicating to ask for a filename (boolean or None). If it is None, the behavior is determined by a configuration option.
download=
  flag indicating a download operation (boolean)

#### HelpBrowser.__urlChanged

__urlChanged(url)

Private slot to handle the urlChanged signal.

url
  the new url (QUrl)

#### HelpBrowser.__virusTotal

__virusTotal(act)

Private slot to scan the selected URL with VirusTotal.

act (QAction)
  reference to the action that triggered

#### HelpBrowser.__webInspector

__webInspector()

Private slot to show the web inspector window.

#### HelpBrowser.__zoomInClickedFrame

__zoomInClickedFrame()

Private slot to zoom into the clicked frame.

#### HelpBrowser.__zoomOutClickedFrame

__zoomOutClickedFrame()

Private slot to zoom out of the clicked frame.

#### HelpBrowser.__zoomResetClickedFrame

__zoomResetClickedFrame()

Private slot to reset the zoom factor of the clicked frame.

#### HelpBrowser.addBookmark

addBookmark()

Public slot to bookmark the current page.

#### HelpBrowser.backward

backward()

Public slot to move backwards in history.

#### HelpBrowser.checkRSS

checkRSS()

Public method to check, if the loaded page contains feed links.

Returns:
  flag indicating the existence of feed links (boolean)

#### HelpBrowser.clearHistory

clearHistory()

Public slot to clear the history.

#### HelpBrowser.closeWebInspector

closeWebInspector()

Public slot to close the web inspector.

#### HelpBrowser.contextMenuEvent

contextMenuEvent(evt)

Protected method called to create a context menu.

This method is overridden from QWebView.

evt
  reference to the context menu event object (QContextMenuEvent)

#### HelpBrowser.copy

copy()

Public slot to copy the selected text.

#### HelpBrowser.createWindow

createWindow(windowType)

Public method called, when a new window should be created.

windowType
  type of the requested window (QWebPage.WebWindowType)

Returns:
  reference to the created browser window (HelpBrowser)

#### HelpBrowser.documentTitle

documentTitle()

Public method to return the title of the loaded page.

Returns:
  title (string)

#### HelpBrowser.dragEnterEvent

dragEnterEvent(evt)

Protected method called by a drag enter event.

evt
  reference to the drag enter event (QDragEnterEvent)

#### HelpBrowser.dragMoveEvent

dragMoveEvent(evt)

Protected method called by a drag move event.

evt
  reference to the drag move event (QDragMoveEvent)

#### HelpBrowser.dropEvent

dropEvent(evt)

Protected method called by a drop event.

evt
  reference to the drop event (QDropEvent)

#### HelpBrowser.event

event(evt)

Public method handling events.

evt
  reference to the event (QEvent)

Returns:
  flag indicating, if the event was handled (boolean)

#### HelpBrowser.findNextPrev

findNextPrev(txt, case, backwards, wrap, highlightAll)

Public slot to find the next occurrence of a text.

txt
  text to search for (string)
case
  flag indicating a case sensitive search (boolean)
backwards
  flag indicating a backwards search (boolean)
wrap
  flag indicating to wrap around (boolean)
highlightAll
  flag indicating to highlight all occurrences (boolean)

Returns:
  flag indicating that a match was found (boolean)

#### HelpBrowser.focusOutEvent

focusOutEvent(evt)

Protected method called by a focus out event.

evt
  reference to the focus event (QFocusEvent)

#### HelpBrowser.forward

forward()

Public slot to move forward in history.

#### HelpBrowser.gestureEvent

gestureEvent(evt)

Protected method handling gesture events.

evt
  reference to the gesture event (QGestureEvent

#### HelpBrowser.getRSS

getRSS()

Public method to get the extracted RSS feeds.

Returns:
  list of RSS feeds (list of tuples of two strings)

#### HelpBrowser.hasRSS

hasRSS()

Public method to check, if the loaded page has RSS links.

Returns:
  flag indicating the presence of RSS links (boolean)

#### HelpBrowser.hasSelection

hasSelection()

Public method to determine, if there is some text selected.

Returns:
  flag indicating text has been selected (boolean)

#### HelpBrowser.home

home()

Public slot to move to the first page loaded.

#### HelpBrowser.isBackwardAvailable

isBackwardAvailable()

Public method to determine, if a backwards move in history is possible.

Returns:
  flag indicating move backwards is possible (boolean)

#### HelpBrowser.isForwardAvailable

isForwardAvailable()

Public method to determine, if a forward move in history is possible.

Returns:
  flag indicating move forward is possible (boolean)

#### HelpBrowser.isLoading

isLoading()

Public method to get the loading state.

Returns:
  flag indicating the loading state (boolean)

#### HelpBrowser.keyPressEvent

keyPressEvent(evt)

Protected method called by a key press.

evt
  reference to the key event (QKeyEvent)

#### HelpBrowser.keyReleaseEvent

keyReleaseEvent(evt)

Protected method called by a key release.

evt
  reference to the key event (QKeyEvent)

#### HelpBrowser.linkedResources

linkedResources(relation="")

Public method to extract linked resources.

relation
  relation to extract (string)

Returns:
  list of linked resources (list of LinkedResource)

#### HelpBrowser.mousePressEvent

mousePressEvent(evt)

Protected method called by a mouse press event.

evt
  reference to the mouse event (QMouseEvent)

#### HelpBrowser.mouseReleaseEvent

mouseReleaseEvent(evt)

Protected method called by a mouse release event.

evt
  reference to the mouse event (QMouseEvent)

#### HelpBrowser.preferencesChanged

preferencesChanged()

Public method to indicate a change of the settings.

#### HelpBrowser.progress

progress()

Public method to get the load progress.

Returns:
  load progress (integer)

#### HelpBrowser.reload

reload()

Public slot to reload the current page.

#### HelpBrowser.saveAs

saveAs()

Public method to save the current page to a file.

#### HelpBrowser.setSource

setSource(name, requestData=None)

Public method used to set the source to be displayed.

name
  filename to be shown (QUrl)
requestData
  tuple containing the request data (QNetworkRequest, QNetworkAccessManager.Operation, QByteArray)

#### HelpBrowser.setZoomValue

setZoomValue(value, saveValue=True)

Public method to set the zoom value.

value
  zoom value (integer)
saveValue= (bool)
  flag indicating to save the zoom value with the zoom manager

#### HelpBrowser.source

source()

Public method to return the URL of the loaded page.

Returns:
  URL loaded in the help browser (QUrl)

#### HelpBrowser.wheelEvent

wheelEvent(evt)

Protected method to handle wheel events.

evt
  reference to the wheel event (QWheelEvent)

#### HelpBrowser.zoomIn

zoomIn()

Public slot to zoom into the page.

#### HelpBrowser.zoomOut

zoomOut()

Public slot to zoom out of the page.

#### HelpBrowser.zoomReset

zoomReset()

Public method to reset the zoom factor.

#### HelpBrowser.zoomValue

zoomValue()

Public method to get the current zoom value.

Returns:
  zoom value (integer)

Up

## HelpWebPage

Class implementing an enhanced web page.

### Derived from

QWebPage

### Class Attributes

_webPluginFactory

### Class Methods

webPluginFactory | Class method to get a reference to the web plug-in factory instance.

### Methods

HelpWebPage | Constructor
__loadStarted | Private method to handle the loadStarted signal.
__managerFinished | Private slot to handle a finished reply.
__restoreFrameStateRequested | Private slot to restore scroll position and zoom level from history.
__saveFrameStateRequested | Private slot to save the page state (i.e.
acceptNavigationRequest | Public method to determine, if a request may be accepted.
addAdBlockRule | Public slot to add an AdBlock rule to the page.
event | Public method implementing the event handler.
extension | Public method to implement a specific extension.
getAdBlockedPageEntries | Public method to get the list of AdBlock page entries.
getSslCertificate | Public method to get a reference to the SSL certificate.
getSslCertificateChain | Public method to get a reference to the SSL certificate chain.
getSslConfiguration | Public method to return a reference to the current SSL configuration.
hasValidSslInfo | Public method to check, if the page has a valid SSL certificate.
pageAttributeId | Public method to get the attribute id of the page attribute.
populateNetworkRequest | Public method to add data to a network request.
setUserAgent | Public method to set the global user agent string.
showSslInfo | Public slot to show some SSL information for the loaded page.
supportsExtension | Public method to check the support for an extension.
url | Public method to get the URL of the page.
userAgent | Public method to get the global user agent setting.
userAgentForUrl | Public method to determine the user agent for the given URL.

### Static Methods

None

#### HelpWebPage.webPluginFactory (class method)

webPluginFactory()

Class method to get a reference to the web plug-in factory instance.

Returns:
  reference to the web plug-in factory instance (WebPluginFactory

#### HelpWebPage (Constructor)

HelpWebPage(parent=None)

Constructor

parent
  parent widget of this window (QWidget)

#### HelpWebPage.__loadStarted

__loadStarted()

Private method to handle the loadStarted signal.

#### HelpWebPage.__managerFinished

__managerFinished(reply)

Private slot to handle a finished reply.

This slot is used to get SSL related information for a reply.

reply
  reference to the finished reply (QNetworkReply)

#### HelpWebPage.__restoreFrameStateRequested

__restoreFrameStateRequested(frame)

Private slot to restore scroll position and zoom level from history.

Note: Code is based on qutebrowser.

frame (QWebFrame)
  frame to be restored

#### HelpWebPage.__saveFrameStateRequested

__saveFrameStateRequested(frame, itm)

Private slot to save the page state (i.e. zoom level and scroll position).

Note: Code is based on qutebrowser.

frame (QWebFrame)
  frame to be saved
itm (QWebHistoryItem)
  web history item to be saved

#### HelpWebPage.acceptNavigationRequest

acceptNavigationRequest(frame, request, type_)

Public method to determine, if a request may be accepted.

frame
  reference to the frame sending the request (QWebFrame)
request
  reference to the request object (QNetworkRequest)
type_
  type of the navigation request (QWebPage.NavigationType)

Returns:
  flag indicating acceptance (boolean)

#### HelpWebPage.addAdBlockRule

addAdBlockRule(rule, url)

Public slot to add an AdBlock rule to the page.

rule
  AdBlock rule to add (AdBlockRule)
url
  URL that matched the rule (QUrl)

#### HelpWebPage.event

event(evt)

Public method implementing the event handler.

evt
  reference to the event (QEvent)

Returns:
  flag indicating that the event was handled (boolean)

#### HelpWebPage.extension

extension(extension, option, output)

Public method to implement a specific extension.

extension
  extension to be executed (QWebPage.Extension)
option
  provides input to the extension (QWebPage.ExtensionOption)
output
  stores the output results (QWebPage.ExtensionReturn)

Returns:
  flag indicating a successful call of the extension (boolean)

#### HelpWebPage.getAdBlockedPageEntries

getAdBlockedPageEntries()

Public method to get the list of AdBlock page entries.

Returns:
  list of AdBlock page entries (list of AdBlockedPageEntry)

#### HelpWebPage.getSslCertificate

getSslCertificate()

Public method to get a reference to the SSL certificate.

Returns:
  amended SSL certificate (QSslCertificate)

#### HelpWebPage.getSslCertificateChain

getSslCertificateChain()

Public method to get a reference to the SSL certificate chain.

Returns:
  SSL certificate chain (list of QSslCertificate)

#### HelpWebPage.getSslConfiguration

getSslConfiguration()

Public method to return a reference to the current SSL configuration.

Returns:
  reference to the SSL configuration in use (QSslConfiguration)

#### HelpWebPage.hasValidSslInfo

hasValidSslInfo()

Public method to check, if the page has a valid SSL certificate.

Returns:
  flag indicating a valid SSL certificate (boolean)

#### HelpWebPage.pageAttributeId

pageAttributeId()

Public method to get the attribute id of the page attribute.

Returns:
  attribute id of the page attribute (integer)

#### HelpWebPage.populateNetworkRequest

populateNetworkRequest(request)

Public method to add data to a network request.

request
  reference to the network request object (QNetworkRequest)

#### HelpWebPage.setUserAgent

setUserAgent(agent)

Public method to set the global user agent string.

agent
  new current user agent string (string)

#### HelpWebPage.showSslInfo

showSslInfo(pos)

Public slot to show some SSL information for the loaded page.

pos
  position to show the info at (QPoint)

#### HelpWebPage.supportsExtension

supportsExtension(extension)

Public method to check the support for an extension.

extension
  extension to test for (QWebPage.Extension)

Returns:
  flag indicating the support of extension (boolean)

#### HelpWebPage.url

url()

Public method to get the URL of the page.

Returns:
  URL of the page (QUrl)

#### HelpWebPage.userAgent

userAgent(resolveEmpty=False)

Public method to get the global user agent setting.

resolveEmpty
  flag indicating to resolve an empty user agent (boolean)

Returns:
  user agent string (string)

#### HelpWebPage.userAgentForUrl

userAgentForUrl(url)

Public method to determine the user agent for the given URL.

url
  URL to determine user agent for (QUrl)

Returns:
  user agent string (string)

Up

## JavaScriptEricObject

Class implementing an external javascript object to search via the startpage.

### Derived from

QObject

### Class Attributes

translations

### Class Methods

None

### Methods

JavaScriptEricObject | Constructor
providerString | Public method to get a string for the search provider.
searchUrl | Public method to get the search URL for the given search term.
translate | Public method to translate the given string.

### Static Methods

None

#### JavaScriptEricObject (Constructor)

JavaScriptEricObject(mw, parent=None)

Constructor

mw
  reference to the main window 8HelpWindow)
parent
  reference to the parent object (QObject)

#### JavaScriptEricObject.providerString

providerString()

Public method to get a string for the search provider.

Returns:
  string for the search provider (string)

#### JavaScriptEricObject.searchUrl

searchUrl(searchStr)

Public method to get the search URL for the given search term.

searchStr
  search term (string)

Returns:
  search URL (string)

#### JavaScriptEricObject.translate

translate(trans)

Public method to translate the given string.

trans
  string to be translated (string)

Returns:
  translation (string)

Up

## JavaScriptExternalObject

Class implementing an external javascript object to add search providers.

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

JavaScriptExternalObject | Constructor
AddSearchProvider | Public slot to add a search provider.

### Static Methods

None

#### JavaScriptExternalObject (Constructor)

JavaScriptExternalObject(mw, parent=None)

Constructor

mw
  reference to the main window 8HelpWindow)
parent
  reference to the parent object (QObject)

#### JavaScriptExternalObject.AddSearchProvider

AddSearchProvider(url)

Public slot to add a search provider.

url
  url of the XML file defining the search provider (string)

Up

## LinkedResource

Class defining a data structure for linked resources.

### Derived from

object

### Class Attributes

None

### Class Methods

None

### Methods

LinkedResource | Constructor

### Static Methods

None

#### LinkedResource (Constructor)

LinkedResource()

Constructor

Up

## contentSniff

contentSniff(data)

Module function to do some content sniffing to check, if the data is HTML.

data
  data block to sniff at (string)

Returns:
  flag indicating HTML content (boolean)

Up