Provides reusable, generic methods for browser specific tasks.
webpg. | Provides reusable, generic methods for browser specific tasks. |
Functions | |
init | Initializes the webpg.utils object and setups up required overrides. |
detectedBrowser | Determines current running browser and returns the a string containing the friendly name. |
resourcePath | Determines the base path for extension resources. |
getParameterByName | Searches the location.search query string for a named parameter |
parseUrl | Returns an object containing the many various elements of a URL |
isValidEmailAddress | Parses a given string to ensure it is a valid email address; Returns true/false |
_onRequest. | This function creates a listener object for interaction between privileged and non-privileged pages |
sendRequest | Sends a request event to the background page or content script |
tabs. | Sends a request to a given tab/frame |
getFrameById | Iterates through the windows to find a frame matching the given ID |
copyToClipboard | Provides a unified method to put data into the clipboard |
openNewTab | Opens a new tab with the location specified and if possible opens the tab at specified index. |
getSelectedText | Gets the selected text for the various types of selections; returns a JSON Object. |
contextMenus. | Removes or hides all items in the context menu. |
contextMenus.add | Adds items to the context menu |
Initializes the webpg.utils object and setups up required overrides.
init: function()
Determines the base path for extension resources.
resourcePath: function()
Searches the location.search query string for a named parameter
getParameterByName: function( parameterName )
Returns an object containing the many various elements of a URL
parseUrl: function( url )
Parses a given string to ensure it is a valid email address; Returns true/false
isValidEmailAddress: function( emailAddress )
Sends a request event to the background page or content script
sendRequest: function( data, callback, doc )
Iterates through the windows to find a frame matching the given ID
getFrameById: function( id )
Provides a unified method to put data into the clipboard
copyToClipboard: function( win, doc )
Opens a new tab with the location specified and if possible opens the tab at specified index.
openNewTab: function( url, tabIndex )
Gets the selected text for the various types of selections; returns a JSON Object.
getSelectedText: function()