Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GoogleChromeLabs/link-to-text-fragment
/ functions
Functions
89 in github.com/GoogleChromeLabs/link-to-text-fragment
⨍
Functions
89
◇
Types & classes
2
↓ 14 callers
Function
checkTimeout
()
fragment-generation-utils.js:1023
↓ 10 callers
Method
backwardsEndOffset
* Helper method for doing arithmetic in the backwards search space. * @return {Number} - the current end offset, as a start offset in the *
fragment-generation-utils.js:1644
↓ 10 callers
Method
backwardsPrefixOffset
* Helper method for doing arithmetic in the backwards search space. * @return {Number} - the current prefix offset, as a start offset in the *
fragment-generation-utils.js:1662
↓ 9 callers
Method
getStartSearchSpace
* @return {String} - the string to be used as the search space for textStart
fragment-generation-utils.js:1562
↓ 9 callers
Method
getSuffixSearchSpace
* @return {String} - the string to be used as the search space for suffix
fragment-generation-utils.js:1626
↓ 8 callers
Function
isBlock
fragment-generation-utils.js:2329
↓ 8 callers
Function
normalizeString
fragment-generation-utils.js:636
↓ 7 callers
Method
getEndSearchSpace
* @return {String} - the string to be used as the search space for textEnd
fragment-generation-utils.js:1578
↓ 7 callers
Function
makeWalkerForNode
(node, endNode)
fragment-generation-utils.js:1965
↓ 6 callers
Method
getPrefixSearchSpace
* @return {String} - the string to be used as the search space for prefix
fragment-generation-utils.js:1602
↓ 5 callers
Function
findTextInRange
(query, range)
fragment-generation-utils.js:433
↓ 5 callers
Function
getFirstNodeForBlockSearch
fragment-generation-utils.js:1806
↓ 4 callers
Function
advanceRangeStartPastOffset
(range, node, offset)
fragment-generation-utils.js:217
↓ 4 callers
Function
enableLinkTextOptions
(enabled)
options.js:29
↓ 4 callers
Function
getLastNodeForBlockSearch
fragment-generation-utils.js:1823
↓ 4 callers
Function
reverseString
fragment-generation-utils.js:1782
↓ 3 callers
Method
getBackwardsPrefixSearchSpace
* @return {String} - the string to be used as the search space for prefix, * backwards.
fragment-generation-utils.js:1619
↓ 3 callers
Function
isText
fragment-generation-utils.js:2338
↓ 3 callers
Function
sendMessageToPage
(message, data = null)
service_worker.js:137
↓ 2 callers
Function
advanceRangeStartToNonWhitespace
fragment-generation-utils.js:229
↓ 2 callers
Method
appendNode
* Adds the next node in the search space range traversal to the accumulator. * The accumulator then will keep track of the text nodes in the range
fragment-generation-utils.js:1705
↓ 2 callers
Function
checkSuffix
(suffix, potentialMatch, searchRange, documentToProcess)
fragment-generation-utils.js:188
↓ 2 callers
Function
doGenerateFragmentFromRange
(range, startTime)
fragment-generation-utils.js:941
↓ 2 callers
Function
expandToNearestWordBoundaryPointUsingSegments
(segmenter, isRangeEnd, range)
fragment-generation-utils.js:2089
↓ 2 callers
Function
findWordStartBoundInTextNode
(node, startOffset)
fragment-generation-utils.js:1909
↓ 2 callers
Method
getBackwardsEndSearchSpace
* @return {String} - the string to be used as the search space for textEnd, * backwards.
fragment-generation-utils.js:1595
↓ 2 callers
Function
getBoundaryPointAtIndex
(index, textNodes, isEnd)
fragment-generation-utils.js:501
↓ 2 callers
Method
getEndSegments
* @return {Segments | Undefined} - the result of segmenting the end search * space using Intl.Segmenter, or undefined if a segmenter was not
fragment-generation-utils.js:1587
↓ 2 callers
Method
getNextOffsetBackwards
* Helper method for embiggening using Intl.Segmenter. Finds the next offset * to be tried in the backwards direction (i.e., a suffix of the search
fragment-generation-utils.js:1532
↓ 2 callers
Method
getNextOffsetForwards
* Helper method for embiggening using Intl.Segmenter. Finds the next offset * to be tried in the forwards direction (i.e., a prefix of the search s
fragment-generation-utils.js:1507
↓ 2 callers
Method
getPrefixSegments
* @return {Segments | Undefined} - the result of segmenting the prefix * search space using Intl.Segmenter, or undefined if a segmenter was not
fragment-generation-utils.js:1611
↓ 2 callers
Function
getSearchSpaceForEnd
fragment-generation-utils.js:1104
↓ 2 callers
Function
getSearchSpaceForStart
fragment-generation-utils.js:1055
↓ 2 callers
Method
getStartSegments
* @return {Segments | Undefined} - the result of segmenting the start search * space using Intl.Segmenter, or undefined if a segmenter was not
fragment-generation-utils.js:1571
↓ 2 callers
Method
getSuffixSegments
* @return {Segments | Undefined} - the result of segmenting the suffix * search space using Intl.Segmenter, or undefined if a segmenter was not
fragment-generation-utils.js:1635
↓ 2 callers
Function
injectContentScripts
(contentScriptNames)
service_worker.js:58
↓ 2 callers
Function
isNodeVisible
fragment-generation-utils.js:300
↓ 2 callers
Function
isUniquelyIdentifying
fragment-generation-utils.js:1773
↓ 2 callers
Function
onCopy
(info, tab)
service_worker.js:165
↓ 2 callers
Method
setBackwardsEndOffset
* Helper method for doing arithmetic in the backwards search space. * @param {Number} backwardsEndOffset - the desired new value of the start *
fragment-generation-utils.js:1653
↓ 2 callers
Method
setBackwardsPrefixOffset
* Helper method for doing arithmetic in the backwards search space. * @param {Number} backwardsPrefixOffset - the desired new value of the prefix
fragment-generation-utils.js:1672
↓ 2 callers
Function
startProcessing
(tab)
service_worker.js:128
↓ 1 callers
Function
acceptNodeIfVisibleInRange
(node, range)
fragment-generation-utils.js:327
↓ 1 callers
Function
acceptTextNodeIfVisibleInRange
(node, range)
fragment-generation-utils.js:346
↓ 1 callers
Function
canUseExactMatch
fragment-generation-utils.js:1795
↓ 1 callers
Function
containsBlockBoundary
fragment-generation-utils.js:1880
↓ 1 callers
Function
copyLink
(linkStyle, url, selectedText, html, linkText)
offscreen.js:3
↓ 1 callers
Function
copyToClipboard
(url, selection)
content_script.js:92
↓ 1 callers
Function
createTextFragment
()
content_script.js:25
↓ 1 callers
Function
doGenerateFragment
(selection, startTime)
fragment-generation-utils.js:924
↓ 1 callers
Method
embiggen
* Shifts the current state such that the candidates for textStart and textEnd * represent more of the possible search spaces. * @return {boolean
fragment-generation-utils.js:1211
↓ 1 callers
Function
expandRangeEndToWordBound
fragment-generation-utils.js:2265
↓ 1 callers
Function
expandRangeStartToWordBound
fragment-generation-utils.js:1992
↓ 1 callers
Function
findRangeFromNodeList
(query, range, textNodes, segmenter)
fragment-generation-utils.js:454
↓ 1 callers
Function
findWordEndBoundInTextNode
(node, endOffset)
fragment-generation-utils.js:1937
↓ 1 callers
Function
forwardTraverse
(walker, finishedSubtrees)
fragment-generation-utils.js:675
↓ 1 callers
Function
getAllTextNodes
(root, range)
fragment-generation-utils.js:362
↓ 1 callers
Function
getElementsIn
* Returns all nodes inside root using the provided filter. * @generator * @param {Node} root - Node where to start the TreeWalker. * @param {Elemen
fragment-generation-utils.js:416
↓ 1 callers
Function
getFirstTextNode
fragment-generation-utils.js:1840
↓ 1 callers
Function
getLastTextNode
fragment-generation-utils.js:1860
↓ 1 callers
Method
getNodeIntersectionWithRange
* Calculates the intersection of a node with searchRange and returns a Text * Node with the intersection * @param {Node} node - the node to inte
fragment-generation-utils.js:1750
↓ 1 callers
Method
getNumberOfContextWordsToAdd
* @return {number} - how many words should be added to the prefix and suffix * when embiggening. This changes depending on the current state of
fragment-generation-utils.js:1484
↓ 1 callers
Method
getNumberOfRangeWordsToAdd
* @return {number} - how many words should be added to textStart and textEnd * when embiggening. This changes depending on the current state of
fragment-generation-utils.js:1494
↓ 1 callers
Function
getTextContent
(nodes, startOffset, endOffset)
fragment-generation-utils.js:391
↓ 1 callers
Function
getTextNodesInSameBlock
fragment-generation-utils.js:2202
↓ 1 callers
Function
isHiddenUntilFound
fragment-generation-utils.js:273
↓ 1 callers
Function
isWordBounded
(text, startPos, length, segmenter)
fragment-generation-utils.js:576
↓ 1 callers
Function
log
(...args)
content_script.js:19
↓ 1 callers
Function
log
(...args)
service_worker.js:52
↓ 1 callers
Function
makeNewSegmenter
()
fragment-generation-utils.js:649
↓ 1 callers
Function
makeTextNodeWalker
fragment-generation-utils.js:261
↓ 1 callers
Function
moveRangeEdgesToTextNodes
fragment-generation-utils.js:2057
↓ 1 callers
Function
processTextFragmentDirective
(textFragment, documentToProcess = document)
fragment-generation-utils.js:50
↓ 1 callers
Function
recordStartTime
fragment-generation-utils.js:1041
↓ 1 callers
Function
reportFailure
(status)
content_script.js:72
↓ 1 callers
Function
reportSuccess
()
content_script.js:54
↓ 1 callers
Method
setExactTextMatch
* Sets up the factory for an exact text match. * * Exactly one of this, setStartAndEndSearchSpace, or setSharedSearchSpace * should be called
fragment-generation-utils.js:1417
↓ 1 callers
Method
setPrefixAndSuffixSearchSpace
* Sets up the factory for context-based matches. * * @param {String} prefixSearchSpace - the string to be used as the search * space for
fragment-generation-utils.js:1433
↓ 1 callers
Method
setSharedSearchSpace
* Sets up the factory for a range-based match with a highlight that doesn't * cross block boundaries. * * Exactly one of this, setStartAndEnd
fragment-generation-utils.js:1398
↓ 1 callers
Method
setStartAndEndSearchSpace
* Sets up the factory for a range-based match with a highlight that crosses * block boundaries. * * Exactly one of this, setSharedSearchSpace
fragment-generation-utils.js:1377
↓ 1 callers
Function
setupOffscreenDocument
(path)
service_worker.js:24
↓ 1 callers
Method
tryToMakeUniqueFragment
* Generates a fragment based on the current state, then tests it for * uniqueness. * @return {TextFragment|Undefined} - a text fragment if the c
fragment-generation-utils.js:1177
↓ 1 callers
Method
useSegmenter
* Sets up the factory to use an instance of Intl.Segmenter when identifying * the start/end of words. |segmenter| is not actually retained; instead
fragment-generation-utils.js:1459
Function
backwardTraverse
(walker, finishedSubtrees)
fragment-generation-utils.js:712
Method
constructor
* Initializes the basic state of the factory. Users should then call exactly * one of setStartAndEndSearchSpace, setSharedSearchSpace, or * setE
fragment-generation-utils.js:1155
Function
generateFragment
(selection, startTime = Date.now())
fragment-generation-utils.js:828
Function
generateFragmentFromRange
(range, startTime = Date.now())
fragment-generation-utils.js:841
Function
isValidRangeForFragmentGeneration
fragment-generation-utils.js:867
Function
setTimeout
fragment-generation-utils.js:793