Пример #1
0
    def every_(self, jsFncs, jsValue=None):
        """
    Description:
    -----------
    The every() method checks if all elements in an array pass a test (provided as a function).
    Data Structure used in this method is like obj(val, index, arra)

    Usage::

      Related Pages:

      https://www.w3schools.com/jsref/jsref_every.asp

    Attributes:
    ----------
    :param jsFncs: A function to be run for each element in the array
    :param jsValue: Optional. A value to be passed to the function to be used as its "this" value.

    :return: None
    """
        jsFncs = JsUtils.jsConvertFncs(jsFncs)
        if jsValue is None:
            return JsFncs.JsFunction(
                "%s.every(function(val, index, arr){%s})" %
                (self.varId, ";".join(jsFncs)))

        return JsFncs.JsFunction(
            "%s.every(function(val, index, arr){%s}, %s)" %
            (self.varId, ";".join(jsFncs), jsValue))
Пример #2
0
    def filter_(self, jsFncs, jsValue=None):
        """
    Description:
    -----------
    The filter() method creates an array filled with all array elements that pass a test (provided as a function)

    Usage::

      Related Pages:

      https://www.w3schools.com/jsref/jsref_filter.asp

    Attributes:
    ----------
    :param jsFncs: A function to be run for each element in the array
    :param jsValue: Optional. A value to be passed to the function to be used as its "this" value.

    :return: None
    """
        jsFncs = JsUtils.jsConvertFncs(jsFncs)
        if jsValue is None:
            return JsFncs.JsFunction(
                "%s.filter(function(val, index, arr){%s))" %
                (self.varId, ";".join(jsFncs)))

        return JsFncs.JsFunction(
            "%s.filter(function(val, index, arr){%s), %s)" %
            (self.varId, ";".join(jsFncs), jsValue))
Пример #3
0
    def filter_(self,
                js_funcs: Union[list, str],
                js_value: Optional[str] = None,
                profile: Union[dict, bool] = False):
        """
    Description:
    -----------
    The filter() method creates an array filled with all array elements that pass a test (provided as a function)

    Related Pages:

    https://www.w3schools.com/jsref/jsref_filter.asp

    Attributes:
    ----------
    :param Union[list, str] js_funcs: A function to be run for each element in the array
    :param Optional[str] js_value: Optional. A value to be passed to the function to be used as its "this" value.
    :param Union[dict, bool] profile: Optional. A flag to set the component performance storage.
    """
        js_funcs = JsUtils.jsConvertFncs(js_funcs, toStr=True, profile=profile)
        if js_value is None:
            return JsFncs.JsFunction(
                "%s.filter(function(val, index, arr){%s))" %
                (self.varId, js_funcs))

        return JsFncs.JsFunction(
            "%s.filter(function(val, index, arr){%s), %s)" %
            (self.varId, js_funcs, js_value))
Пример #4
0
  def alert(self, data, js_funcs: Union[list, str] = None, window_id: str = "window", skip_data_convert: bool = False):
    """
    Description:
    ------------
    The alert() method displays an alert box with a specified message and an OK button.

    Usage::

      page.js.window.alert("Test")
      page.js.alert("Test 2")

    Related Pages:

      https://www.w3schools.com/jsref/met_win_alert.asp

    Attributes:
    ----------
    :param data: Optional. Specifies the text to display in the alert box, or an object converted into a string and
      displayed
    :param Union[list, str] js_funcs: A JsFnc or a list of JsFncs.
    :param str window_id: Optional. The JavaScript window object reference variable.
    :param bool skip_data_convert:
    """
    if skip_data_convert:
      return JsFncs.JsFunction("%s.alert(%s)" % (window_id, data))

    if hasattr(data, 'dom'):
      data = data.dom.content
    return JsFncs.JsFunction("%s.alert(%s)" % (window_id, JsUtils.jsConvertData(data, js_funcs)))
Пример #5
0
    def clearMarks(self, name: Optional[str] = None):
        """
    Description:
    ------------
    The clearMarks() method removes the named mark from the browser's performance entry buffer.
    If the method is called with no arguments, all performance entries with an entry type of "mark" will be removed
    from the performance entry buffer.

    Usage::

      performance.clearMarks("a")

    Related Pages:

      https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMarks

    Attributes:
    ----------
    :param Optional[str] name: Optional. The mark name.

    :return: Void, the String for the Javascript side
    """
        if name is not None:
            if name not in self.__marks:
                raise ValueError("Mark %s not defined in the performances" %
                                 name)

            return JsFncs.JsFunction("performance.clearMarks(%s)" % name)

        return JsFncs.JsFunction("performance.clearMarks()")
Пример #6
0
  def download(self, data, file_name: str, profile: Optional[Union[dict, bool]] = False):
    """
    Description:
    ------------
    Download the data from a flat file.

    Usage::

      page.js.window.download(rptObj.js.window.btoa(rptObj.js.objects.get("test")), fileName="test.txt")

    Attributes:
    ----------
    :param data:
    :param file_name:
    :param Optional[Union[dict, bool]] profile: Optional. A flag to set the component performance storage.

    :return: Void,
    """
    data = JsUtils.jsConvertData(data, None)
    return JsFncs.JsFunction(JsUtils.jsConvertFncs([
      self.page.js.createElement("a", js_code="a_temp").setAttribute("download", file_name).setAttribute(
        "href", JsFncs.JsFunction("'data:text/csv;base64,'+ %s" % data)),
      self.page.js.body.appendChild(self.page.js.objects.get("a_temp")),
      self.page.js.objects.dom.get("a_temp").click(),
      #self.__src.objects.dom.get("a_temp").remove()
    ], toStr=True, profile=profile))
Пример #7
0
    def every_(self,
               js_funcs: Union[list, str],
               js_value: Optional[str] = None,
               profile: Union[dict, bool] = False):
        """
    Description:
    -----------
    The every() method checks if all elements in an array pass a test (provided as a function).
    Data Structure used in this method is like obj(val, index, array)

    Usage::

      Related Pages:

      https://www.w3schools.com/jsref/jsref_every.asp

    Attributes:
    ----------
    :param Union[list, str] js_funcs: A function to be run for each element in the array
    :param Optional[str] js_value: Optional. A value to be passed to the function to be used as its "this" value.
    :param Union[dict, bool] profile: Optional. A flag to set the component performance storage.
    """
        js_funcs = JsUtils.jsConvertFncs(js_funcs, toStr=True, profile=profile)
        if js_value is None:
            return JsFncs.JsFunction(
                "%s.every(function(val, index, arr){%s})" %
                (self.varId, js_funcs))

        return JsFncs.JsFunction(
            "%s.every(function(val, index, arr){%s}, %s)" %
            (self.varId, js_funcs, js_value))
Пример #8
0
    def clearMeasures(self, name: Optional[str] = None):
        """
    Description:
    ------------
    The clearMeasures() method removes the named measure from the browser's performance entry buffer.
    If the method is called with no arguments, all performance entries with an entry type of "measure" will be removed
    from the performance entry buffer.

    Usage::

      performance.clearMeasures("a");

    Related Pages:

      https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures

    Attributes:
    ----------
    :param Optional[str] name: Optional. The name of the mark to be cleared.

    :return: Void, the String for the Javascript side
    """
        if name is not None:
            self.__marks.remove(name)
            return JsFncs.JsFunction("performance.clearMeasures(%s)" % name)

        return JsFncs.JsFunction("performance.clearMeasures()")
Пример #9
0
  def pushState(self, state, title, url):
    """
    Description:
    ------------
    Pushes the given data onto the session history stack with the specified title and, if provided, URL.

    Note that pushState() never causes a hashchange event to be fired, even if the new URL differs from the old URL
    only in its hash

    Related Pages:

      https://developer.mozilla.org/en-US/docs/Web/API/History_API

    Attributes:
    ----------
    :param state: The state object is a JavaScript object which is associated with the new history entry created by
      pushState()
    :param title: Firefox currently ignores this parameter, although it may use it in the future
                  Passing the empty string here should be safe against future changes to the method.
                  Alternatively, you could pass a short title for the state to which you're moving.
    :param url: The new history entry's URL is given by this parameter.
                Note that the browser won't attempt to load this URL after a call to pushState(),

    :return:
    """
    return JsFncs.JsFunction("window.history.pushState('%s', '%s', %s)" % (state, title, url))
Пример #10
0
    def findIndex(self,
                  js_funcs: Union[list, str],
                  profile: Union[dict, bool] = False):
        """
    Description:
    -----------
    The find() method returns the value of the first element in an array that pass a test (provided as a function)

    Usage::

      jsObj.console.log(jsObj.objects.array.get("MyArray").findIndex([
      jsObj.if_(jsObj.data.loop.val <= 0, [jsObj.return_(jsObj.objects.true)]),
      jsObj.return_(jsObj.objects.false)
      ]))

    Related Pages:

      https://www.w3schools.com/jsref/jsref_findindex.asp

    Attributes:
    ----------
    :param Union[list, str] js_funcs: function(currentValue, index, arr)	Required. A function to be run for each
    element in the array.
    :param Union[dict, bool] profile: Optional. A flag to set the component performance storage.

    :return: Returns the array element index if any of the elements in the array pass the test, otherwise it returns -1
    """
        js_funcs = JsUtils.jsConvertFncs(js_funcs, toStr=True, profile=profile)
        return JsFncs.JsFunction(
            "%s.findIndex(function(value, index, arr){%s})" %
            (self.varId, js_funcs))
Пример #11
0
  def removeItem(self, data, key: Union[str, primitives.JsDataModel] = None, is_py_data: bool = False,
                 js_funcs: Union[list, str] = None):
    """
    Description:
    ------------
    Syntax for REMOVING ALL saved data from sessionStorage.

    The sessionStorage object stores data for only one session (the data is deleted when the browser tab is closed).

    Usage::

      jsObj.sessionStorage.removeItem("lastname")

    Related Pages:

      https://www.w3schools.com/jsref/met_storage_removeitem.asp

    Attributes:
    ----------
    :param data:
    :param key:
    :param bool is_py_data:
    :param Union[list, str] js_funcs:
    """
    data = JsUtils.jsConvert(data, key, is_py_data, js_funcs)
    return JsFncs.JsFunction("sessionStorage.removeItem(%s)" % data)
Пример #12
0
  def removeItem(self, key: Union[primitives.JsDataModel, str]):
    """
    Description:
    ------------
    The removeItem() method removes the specified Storage Object item.

    The localStorage object stores data with no expiration date.
    The data will not be deleted when the browser is closed, and will be available the next day, week, or year.

    Usage::

      jsObj.localStorage.removeItem("lastname")

    Related Pages:

      https://www.w3schools.com/jsref/met_storage_removeitem.asp

    Attributes:
    ----------
    :param Union[primitives.JsDataModel, str] key: A String specifying the name of the item you want to remove.

    :return: Void
    """
    key = JsUtils.jsConvertData(key, None)
    return JsFncs.JsFunction("localStorage.removeItem(%s)" % key)
Пример #13
0
    def forEach(self,
                js_funcs: Union[list, str],
                value: str = "value",
                profile: Union[dict, bool] = False):
        """
    Description:
    -----------
    The forEach() method calls a provided function once for each element in an array, in order.

    Usage::

      jsObj.objects.get("MyObject").keys().forEach([
      jsObj.console.log(jsObj.data.loop.val)])

    Related Pages:

      https://www.w3schools.com/jsref/jsref_foreach.asp

    Attributes:
    ----------
    :param Union[list, str] js_funcs: A function to be run for each element in the array
    :param Optional[str] value: Optional. A value to be passed to the function to be used as its "this" value.
    :param Union[dict, bool] profile: Optional. A flag to set the component performance storage.
    """
        js_funcs = JsUtils.jsConvertFncs(js_funcs, toStr=True, profile=profile)
        return JsFncs.JsFunction("%s.forEach(function(%s, index, arr){%s})" %
                                 (self.varId, value, js_funcs))
Пример #14
0
  def clearInterval(self, var_id: str, window_id: str = "window"):
    """
    Description:
    ------------
    The clearInterval() method clears a timer set with the setInterval() method.

    The ID value returned by setInterval() is used as the parameter for the clearInterval() method.

    Usage::

      jsObj.window.setInterval([jsObj.console.log(jsObj.math.random())], 500).setVar("interva1"),
      jsObj.window.clearInterval(jsObj.objects.get("interva1"))

    Related Pages:

      https://www.w3schools.com/jsref/met_win_clearinterval.asp

    #TODO: Check if interval is unique

    Attributes:
    ----------
    :param str var_id: A PythonJs object (JsArray, JsObject...) or reference
    :param str window_id: The JavaScript window object.

    :return: Void, The Javascript String
    """
    js_data = var_id if not hasattr(var_id, "toStr") else JsUtils.jsConvertData(var_id, None)
    return JsFncs.JsFunction("%s.clearInterval(%s); %s = undefined" % (window_id, js_data, js_data))
Пример #15
0
    def replace(self,
                url: Union[str, primitives.JsDataModel],
                secured: bool = False):
        """
    Description:
    ------------
    The replace() method replaces the current document with a new one.

    The difference between this method and assign(), is that replace() removes the URL of the current document
    from the document history, meaning that it is not possible to use the "back" button to navigate back to the
    original document.

    Related Pages:

      https//www.w3schools.com/jsref/met_loc_replace.asp

    Attributes:
    ----------
    :param Union[str, primitives.JsDataModel] url: Specifies the URL of the page to navigate to.
    :param bool secured: Optional. If the http is missing. This will be used to fix the url.
    """
        if url.startswith("www."):
            url = r"http:\\%s" % url if not secured else r"https:\\%s" % url
        js_data = JsUtils.jsConvertData(url, None)
        return JsFncs.JsFunction("location.replace(%s)" % js_data)
Пример #16
0
  def open(self, url: str, name: str = "_self", specs: list = None, replace: bool = None, window_id: str = "window"):
    """
    Description:
    ------------
    Opens a new browser window

    Related Pages:

      https://www.w3schools.com/Jsref/met_win_open.asp

    Attributes:
    ----------
    :param str url: Optional. Specifies the URL of the page to open. If no URL is specified, a new window/tab with
      about:blank is opened
    :param str name: Optional. Specifies the target attribute or the name of the window.
    :param list specs: Optional. A comma-separated list of items, no whitespaces.
    :param bool replace: Optional. Specifies whether the URL creates a new entry or replaces the current entry in
      the history list
    :param str window_id: Optional. The JavaScript window object reference variable.
    """
    url = JsUtils.jsConvertData(url, None)
    name = JsUtils.jsConvertData(name, None)
    specs = JsUtils.jsConvertData(specs, None)
    replace = JsUtils.jsConvertData(replace, None)
    return JsFncs.JsFunction("%s.open(%s, %s, %s, %s)" % (window_id, url, name, specs, replace))
Пример #17
0
    def mark(self, name: Union[primitives.JsDataModel, str]):
        """
    Description:
    ------------
    The mark() method creates a timestamp in the browser's performance entry buffer with the given name.
    The application defined timestamp can be retrieved by one of the Performance interface's getEntries*() methods
    (getEntries(), getEntriesByName() or getEntriesByType()).

    Usage::

      performance.mark("a")

    Related Pages:

      https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark

    Attributes:
    ----------
    :param Union[primitives.JsDataModel, str] name: A DOMString representing the name of the mark.

    :return: Void, The String for the Javascript side.
    """
        self.__marks.add(name)
        name = JsUtils.jsConvertData(name, None)
        return JsFncs.JsFunction("performance.mark(%s)" % name)
Пример #18
0
    def findIndex(self, jsFnc):
        """
    Description:
    -----------
    The find() method returns the value of the first element in an array that pass a test (provided as a function)

    Usage::

      jsObj.console.log(jsObj.objects.array.get("MyArray").findIndex([
      jsObj.if_(jsObj.data.loop.val <= 0, [jsObj.return_(jsObj.objects.true)]),
      jsObj.return_(jsObj.objects.false)
      ]))

    Related Pages:

      https://www.w3schools.com/jsref/jsref_findindex.asp

    Attributes:
    ----------
    :param jsFnc: function(currentValue, index, arr)	Required. A function to be run for each element in the array.

    :return: Returns the array element index if any of the elements in the array pass the test, otherwise it returns -1
    """
        jsFnc = JsUtils.jsConvertFncs(jsFnc)
        return JsFncs.JsFunction(
            "%s.findIndex(function(value, index, arr){%s})" %
            (self.varId, ";".join(jsFnc)))
Пример #19
0
    def clearData(self, format=None):
        """
    Description:
    -----------
    Remove the data associated with a given type. The type argument is optional.
    If the type is empty or not specified, the data associated with all types is removed.
    If data for the specified type does not exist, or the data transfer contains no data, this method will have no effect.

    Related Pages:

      https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/clearData
    """
        if format is None:
            return JsFncs.JsFunction("%s.clearData()" % self.varId)

        format = JsUtils.jsConvertData(format, None)
        return JsFncs.JsFunction("%s.clearData(%s)" % (self.varId, format))
Пример #20
0
    def disconnect(self):
        """
    Description:
    ------------
    The IntersectionObserver method disconnect() stops watching all of its target elements for visibility changes.

    https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/disconnect
    """
        return JsFncs.JsFunction("%s.disconnect()")
Пример #21
0
    def open_new_tab(self,
                     url: Union[str, primitives.JsDataModel],
                     name: Union[str, primitives.JsDataModel] = "_blank",
                     specs: Union[str, primitives.JsDataModel] = None,
                     replace: Union[str, primitives.JsDataModel] = None,
                     window_id: str = "window",
                     secured: bool = False):
        """
    Description:
    ------------
    Opens a new browser window in a new tab (duplicated but part of the Window module).

    Usage::

      page.js.location.open_new_tab("www.google.fr")

    Related Pages:

      https://www.w3schools.com/Jsref/met_win_open.asp

    Attributes:
    ----------
    :param Union[str, primitives.JsDataModel] url: Optional. Specifies the URL of the page to open. If no URL is
    specified, a new window/tab with about:blank is opened
    :param Union[str, primitives.JsDataModel] name: Optional. Specifies the target attribute or the name of the window.
    Default _blank.
    :param Union[str, primitives.JsDataModel] specs: Optional. A comma-separated list of items, no whitespaces.
    :param Union[str, primitives.JsDataModel] replace: Optional. Specifies whether the URL creates a new entry or
    replaces the current entry in the history list
    :param str window_id: The JavaScript window object
    :param bool secured:
    """
        if not hasattr(url, 'toStr') and url.startswith("www."):
            url = r"http:\\%s" % url if not secured else r"https:\\%s" % url
        url = JsUtils.jsConvertData(url, None)
        name = JsUtils.jsConvertData(name, None)
        if specs is None:
            return JsFncs.JsFunction("%s.open(%s, %s)" %
                                     (window_id, url, name))

        specs = JsUtils.jsConvertData(specs, None)
        replace = JsUtils.jsConvertData(replace, None)
        return JsFncs.JsFunction("%s.open(%s, %s, %s, %s)" %
                                 (window_id, url, name, specs, replace))
Пример #22
0
  def scrollUp(self, window_id: str = "window"):
    """
    Description:
    ------------

    Attributes:
    ----------
    :param str window_id: Optional. The JavaScript window object reference variable.
    """
    return JsFncs.JsFunction("%s.scrollTo(0, 0)" % window_id)
Пример #23
0
    def measure(self,
                name: Union[primitives.JsDataModel, str],
                start_mark: Optional[str] = None,
                end_mark: Optional[str] = None):
        """
    Description:
    ------------
    The measure() method creates a named timestamp in the browser's performance entry buffer between marks,
    the navigation start time, or the current time.

    When measuring between two marks, there is a start mark and end mark, respectively.
    The named timestamp is referred to as a measure.

    Related Pages:

      https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure

    Attributes:
    ----------
    :param str name: A DOMString representing the name of the measure.
    :param Optional[str] start_mark: Optional. A DOMString representing the name of the measure's starting mark.
    :param Optional[str] end_mark: Optional, A DOMString representing the name of the measure's ending mark.

    :return: Void, The String for the Javascript side
    """
        name = JsUtils.jsConvertData(name, None)
        if start_mark is not None:
            if start_mark not in self.__marks:
                raise ValueError("Mark %s not defined in the performances" %
                                 start_mark)

            if end_mark is not None:
                if start_mark not in self.__marks:
                    raise ValueError(
                        "Mark %s not defined in the performances" % start_mark)

                return JsFncs.JsFunction("performance.measure(%s, %s, %s)" %
                                         (name, start_mark, end_mark))
            else:
                return JsFncs.JsFunction("performance.measure(%s, '%s')" %
                                         (name, end_mark))

        return JsFncs.JsFunction("performance.measure(%s)" % name)
Пример #24
0
  def setInterval(self, js_funcs: Union[list, str], var_id: str, milliseconds: int, window_id: str = "window",
                  set_var: bool = True, profile=False):
    """
    Description:
    ------------
    The setInterval() method calls a function or evaluates an expression at specified intervals (in milliseconds).

    The setInterval() method will continue calling the function until clearInterval() is called, or the window
    is closed.

    Usage::

      jsObj.window.setInterval([jsObj.console.log(jsObj.math.random())], 5000)

    Related Pages:

      https://www.w3schools.com/jsref/met_win_setinterval.asp

    #TODO: Add a control on setInterval to only have one created

    Attributes:
    ----------
    :param Union[list, str] js_funcs: The function that will be executed.
    :param str var_id: The JavaScript variable name.
    :param int milliseconds: The intervals (in milliseconds) on how often to execute the code.
    If the value is less than 10, the value 10 is used.
    :param str window_id: The JavaScript window object.
    :param bool set_var: Set the variable on the JavaScript side.
    :param profile: Boolean | Dictionary. Optional. A flag to set the component performance storage.
    """
    js_funcs = JsUtils.jsConvertFncs(js_funcs, toStr=True, profile=profile)
    if set_var:
      if window_id == 'window':
        # To make the variable scope as global
        var_id = "window['%s']" % var_id
      else:
        var_id = "var %s" % var_id

      return JsFncs.JsFunction(
        "%s = %s.setInterval(function(){%s}, %s)" % (var_id, window_id, js_funcs, milliseconds))

    return JsFncs.JsFunction("%s.setInterval(function(){%s}, %s)" % (window_id, js_funcs, milliseconds))
Пример #25
0
  def getSelection(self, window_id: str = "window"):
    """
    Description:
    ------------
    Returns a Selection object representing the range of text selected by the user.

    Attributes:
    ----------
    :param str window_id: The JavaScript window object
    """
    return JsFncs.JsFunction("%s.getSelection()" % window_id)
Пример #26
0
  def error(self, time, color="red"):
    """
    Description:
    -----------

    Attributes:
    ----------
    :param time:
    :param color:
    """
    return JsFncs.JsFunction("var bgColor = %s.style.borderColor; %s.style.borderColor = '%s'; setTimeout(function() {%s.style.borderColor = bgColor}, %s)" % (self.varName, self.varName, color, self.varName, time))
Пример #27
0
    def setData(self, data, format='text'):
        """
    Description:
    -----------

    :param data:
    :param format:
    """
        format = JsUtils.jsConvertData(format, None)
        data = JsUtils.jsConvertData(data, None)
        return JsFncs.JsFunction("%s.setData(%s, %s)" %
                                 (self.varId, format, data))
Пример #28
0
  def position(self, val, js_funcs: Union[List[Union[str, primitives.JsDataModel]], str]):
    """
    Description:
    ------------

    Attributes:
    ----------
    :param val:
    :param Union[List[Union[str, primitives.JsDataModel]], str] js_funcs: Javascript functions.
    """
    return JsFncs.JsFunction("if((%(content)s >= %(val)s) && (%(content)s <= %(val)s + 10)){%(fnc)s}" % {
      'content': self.content, 'val': val, 'fnc': JsUtils.jsConvertFncs(js_funcs, toStr=True)})
Пример #29
0
  def forward(self):
    """
    Description:
    ------------
    The forward() method loads the next URL in the history list.

    Related Pages:

      https://www.w3schools.com/jsref/met_his_forward.asp

    :return: The Javascript String to be added to the page.
    """
    return JsFncs.JsFunction("window.history.forward()")
Пример #30
0
    def takeRecords(self):
        """
    Description:
    ------------
    The IntersectionObserver method takeRecords() returns an array of IntersectionObserverEntry objects, one for each targeted element which has experienced an intersection change since the last time the intersections were checked, either explicitly through a call to this method or implicitly by an automatic call to the observer's callback.

    Related Pages:

      https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/takeRecords

    :return: An array of IntersectionObserverEntry objects, one for each target element whose intersection with the root has changed since the last time the intersections were checked.
    """
        return JsFncs.JsFunction("%s.takeRecords()")