MCPcopy Create free account
hub / github.com/PageBot/PageBot / clearJs

Method clearJs

Lib/pagebot/contexts/htmlcontext/htmlbuilder.py:353–358  ·  view source on GitHub ↗

Clearing the JS-output storage in the page. Should be called for every page when exporting a site, or else the JS will cumulate from precious pages.

(self)

Source from the content-addressed store, hash-verified

351 # J S
352
353 def clearJs(self):
354 """Clearing the JS-output storage in the page. Should be called for every page
355 when exporting a site, or else the JS will cumulate from precious pages.
356 """
357 self._jsOut = []
358 self._jsNames = set() # Keep optional js chunck names, so avoid double output.
359
360 def addJs(self, js, name=None):
361 """Add js to output, if name is None or optional name is not already in self._jsNames.

Callers 2

__init__Method · 0.95
buildMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected