forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple extension bar to the SafariDriver. The bar will be used to
display banner messages to the user (e.g. the currently executing command)
- Loading branch information
Showing
8 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!DOCTYPE html> | ||
WebDriver |<span style="margin-left: 10px; font-style: italic" | ||
id="message"><idle></span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2013 Selenium committers | ||
// Copyright 2013 Software Freedom Conservancy | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
/** | ||
* @fileoverview Utilities for working with the browser window extension bar. | ||
*/ | ||
|
||
goog.provide('safaridriver.extension.bar'); | ||
|
||
|
||
/** | ||
* Sets the message to display to the user in the extension bar. | ||
* @param {string} message The message text. | ||
* @param {string=} opt_color The message color; defaults to black. | ||
*/ | ||
safaridriver.extension.bar.setUserMessage = function(message, opt_color) { | ||
var color = opt_color || 'black'; | ||
if (message.length > 75) { | ||
message = message.substring(0, 75) + '...'; | ||
} | ||
|
||
var bars = safari.extension.bars; | ||
for (var i = 0, n = bars.length; i < n; ++i) { | ||
var bar = bars[i]; | ||
var msgEl = bar.contentWindow.document.getElementById('message'); | ||
if (msgEl) { | ||
msgEl.innerText = message; | ||
msgEl.style.color = color; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+487 Bytes
(100%)
javascript/safari-driver/prebuilt/SafariDriver.safariextz
Binary file not shown.