// Licensed to the Software Freedom Conservancy (SFC) under one1// or more contributor license agreements. See the NOTICE file2// distributed with this work for additional information3// regarding copyright ownership. The SFC licenses this file4// to you under the Apache License, Version 2.0 (the5// "License"); you may not use this file except in compliance6// with the License. You may obtain a copy of the License at7//8// http://www.apache.org/licenses/LICENSE-2.09//10// Unless required by applicable law or agreed to in writing,11// software distributed under the License is distributed on an12// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY13// KIND, either express or implied. See the License for the14// specific language governing permissions and limitations15// under the License.1617/**18* @fileoverview Overall configuration of the browser automation atoms.19*/202122goog.provide('bot');232425/**26* Frameworks using the atoms keep track of which window or frame is currently27* being used for command execution. Note that "window" may not always be28* defined (for example in firefox extensions)29* @private {!Window}30*/31bot.window_;3233try {34bot.window_ = window;35} catch (ignored) {36// We only reach this place in a firefox extension.37bot.window_ = goog.global;38}394041/**42* Returns the window currently being used for command execution.43*44* @return {!Window} The window for command execution.45*/46bot.getWindow = function () {47return bot.window_;48};495051/**52* Sets the window to be used for command execution.53*54* @param {!Window} win The window for command execution.55*/56bot.setWindow = function (win) {57bot.window_ = win;58};596061/**62* Returns the document of the window currently being used for63* command execution.64*65* @return {!Document} The current window's document.66*/67bot.getDocument = function () {68return bot.window_.document;69};707172