summaryrefslogtreecommitdiff
path: root/ext/fg/js
Commit message (Collapse)AuthorAge
* Set content refactor (#686)toasted-nutbread2020-07-25
| | | | | | | | | | | | | | | | | | | | | | | * Simplify invoke * Pass isTerms instead of type * Update DisplaySearch.setContent to pass argument array * Simplify argument object structure for setContent * Move focus and disableHistory level * Always include focus and disableHistory options * Change disableHistory to history * Pass source text to setContent * Use consistent argument/object field order * Remove unused previous field * Combine logic for forward/back navigation
* Simplify Popup.showContent API to use only two details arguments (#684)toasted-nutbread2020-07-24
|
* Display refactoring (#674)toasted-nutbread2020-07-18
| | | | | | | | | * Move setupNestedPopups to Display * Move auto-play timer and delay into Display * Move some message handler definitions into Display * Move default optionsContext definition
* Script ready state change (#672)toasted-nutbread2020-07-18
| | | | | | | * Update how backend/frontend ready states are awaited and signaled * Log errors on the search page * Update action name
* Content script ready checks (#670)toasted-nutbread2020-07-18
| | | | | * Move ready checkout of Display * Add function to wait until if a tab's content script is ready
* Extension unload indication fix (#662)toasted-nutbread2020-07-18
| | | | | | | | | | | | | | | | | | | * Remove unused function * Rename field * Change extensionUnloaded trigger function * Update how extension unloaded content is shown * Ignore certain errors caused by extension unload * Add _showExtensionUnloaded function * Wrap internals of updateOptions * Suppress errors caued by extension unload * Make the frontend trigger the popup's extensionUnloaded event
* Message handler refactor (#660)toasted-nutbread2020-07-11
| | | | | | | | | | | * Refactor searchQueryUpdate action * Use standard message handler style * Use name "promiseOrResult" for consistency * Use standard message handler convention for Yomichan message handlers * Use common message handler invoker
* Popup crossFrame communication (#658)toasted-nutbread2020-07-10
| | | | | | | | | * Add support for dynamic message handlers * Pass messages using crossFrame.invoke instead of contentWindow.postMessage * Set up async handlers * Simplify configure call and response
* Various updates to FrameOffsetForwarder (#657)toasted-nutbread2020-07-10
| | | | | | | | | | | | | * Remove bindings * Fast exit if same window * Simplify selector * Rename functions, reuse _getFrameOffsetParent * Update message style * Send reply message to a specific frame
* Add support for async vs non-async (#656)toasted-nutbread2020-07-10
|
* Refactor hotkey definitions to be more generic (#655)toasted-nutbread2020-07-08
|
* Generalized frame connections (#654)toasted-nutbread2020-07-08
| | | | | | | | | * Create FrameClient and FrameEndpoint * Use new Frame* classes for Popup=>frame connection * Update api.sendMessageToFrame and api.broadcastTab to include the sender's frameId * Update FrameClient to store the frame's frameId
* Refactor DisplayFloat=>Frontend message passing (#652)toasted-nutbread2020-07-08
| | | | | | | | | | | * Change getOrCreatePopup arguments to be an object * Add ownerFrameId to popup and DisplayFloat * Refactor DisplayFloat host action invocation * Use CrossFrameAPI instead of window.postMessage * Update popup closing functionality on the search page
* Display class refactoring (#650)toasted-nutbread2020-07-03
| | | | | | | | | | | | | | | | | | | | | | | * Organize by public/private * Don't access super class's private members * Make _autoPlayAudioTimer private * Refactor constructors * Make functions private * Organize by public/private * Organize window message handlers * Make fields private * Refactor DisplaySearch constructor * Make functions private * Organize by public/private
* Extension unload detection (#647)toasted-nutbread2020-07-03
| | | | | | | * Update how extension unload is detected * Remove event handlers and use yomichan.isExtensionUnloaded instead * Update terminology
* Display refactor (#643)toasted-nutbread2020-07-03
| | | | | | | | | | | | | | | | | | | * Remove statics * Move orphan detection and error handling to Display * Add clearContent function * Add/use public get/set functions for optionsContext * Add public getOptions * Move interactive assignment * Mark fields as private * Mark functions as private * Change stray getter into a function
* Make PopupProxy._frameOffsetExpireTimeout non-static (#640)toasted-nutbread2020-07-03
|
* Don't use/assign popup private fields without using "this" (#635)toasted-nutbread2020-07-03
|
* Use deferPromise (#630)toasted-nutbread2020-06-28
| | | | | | | * Use deferPromise * Move definition * Implement promiseTimeout using deferPromise
* Yomichan object separation (#627)toasted-nutbread2020-06-28
| | | | | | | | | | | | | * Move "yomichan" object setup to a separate file * Update script imports * Align message handlers * Rename Yomichan.prepare to Yomichan.ready * Add new prepare function * Improve isExtensionUrl
* Make PopupFactory.prepare non-async (#625)toasted-nutbread2020-06-25
|
* Shadow DOM container for popup iframes (#623)toasted-nutbread2020-06-24
| | | | | | | | | | | | | | | * Add support for injecting stylesheets into a custom parent node * Add api.getStylesheetContent * Add support for injecting a CSS file's content * Add usePopupShadowDom option * Use a per-parentNode cache * Add support for using a shadow DOM wrapper around popup iframes * Ignore the popup container instead of the frame
* Remove window. from visualViewport, use local variable instead (#621)toasted-nutbread2020-06-22
|
* Secure popup frame url changes (#622)toasted-nutbread2020-06-22
| | | | | | | * Throw error if options is not ready * Remove id * Change unsecurePopupFrameUrl to useSecurePopupFrameUrl
* Frontend initialization refactor (#610)toasted-nutbread2020-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Create member functions for ignoreElements and ignorePoint * Create addFullscreenChangeEventListener utility * Move popup creation management into Frontend * Move getUrl implementation * Remove old setup * Remove try/catch block * Error wrap * Add prepare call to TextScanner * Update depth when popup changes * Refactor how Frontend gets PopupFactory and frameId * Update popup preview to work * Update popup preview frame to use the frontend's popup * Update how nested popups are set up * Error wrap * Update how popups are set up on the search page * Error wrap * Error unwrap * Add missing prepare * Remove use of frontendInitializationData * Catch and log errors
* Use DOMTextScanner (#536)toasted-nutbread2020-06-21
| | | | | | | | | | | | | | | | | * Use DOMTextScanner instead of TextSourceRange.seek* * Move getNodesInRange to dom.js * Move anyNodeMatchesSelector to dom.js * Remove unused functions * Update tests * Add layoutAwareScan option * Use layoutAwareScan for source and sentence scanning * Remove unused IGNORE_TEXT_PATTERN
* Add option to use the unsecure frame URL (#618)toasted-nutbread2020-06-21
|
* Ignore getZoom errors (#604)toasted-nutbread2020-06-14
|
* PopupProxy refactor (#609)toasted-nutbread2020-06-14
| | | | | | | | | | | * Remove setDisabled member; replace with an event * Pass frameOffsetForwarder directly to PopupProxy * Replace .start with .prepare * Make onMessage private * Make message safer and handle unexpected inputs
* Use cross frame API (#553)toasted-nutbread2020-06-07
| | | | | | | | | * Use new CrossFrameAPI for popup proxy communication * Remove use of old cross-frame communication classes * Remove use of old cross-frame communication files * Make the crossFrame object a member of the api object
* Ensure single popup factory (#554)toasted-nutbread2020-05-24
| | | | | * Add createPopupFactory * Ensure only a single PopupFactory is generated
* API refactor (#532)toasted-nutbread2020-05-24
| | | | | | | | | | | | | * Convert api.js into a class instance * Use new api.* functions * Fix missing binds * Group functions with progress callbacks together * Change style * Fix API override not working
* Dynamic loader load style (#521)toasted-nutbread2020-05-19
| | | | | | | | | * Remove unnecessary load of /fg/css/client.css * Replace dynamicLoader.loadStyles with dynamicLoader.loadStyle * Replace Popup._injectStylesheet with dynamicLoader.loadStyle * Remove unused global
* Use both shadowRoot and openOrClosedShadowRoot (#534)toasted-nutbread2020-05-10
|
* Load frame content using contentDocument.location.href instead of src ↵toasted-nutbread2020-05-10
| | | | attribute (#529)
* Text source refactor (#527)toasted-nutbread2020-05-10
| | | | | | | | | * Update TextSourceElement API to have parity with TextSourceRange * Make fields private * Update equality check * Fix "this.element" being used instead of just "element"
* Fix setStartOffset not appending (#526)toasted-nutbread2020-05-09
|
* Frontend/popup proxy message refactoring (#520)toasted-nutbread2020-05-09
| | | | | | | | | | | | | * Use direct message handler functions * Remove unused targetPopupId * Make target a member of FrontendApiSender * Rename frameId to parentFrameId for clarity * Remove _parentFrameId * Rename _parentId to _parentPopupId for clarity
* Popup refactor (#518)toasted-nutbread2020-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | * Add default * Convert function to non-static * Remove static for private functions * Replace .call * Move functions with side effects into a synchronous prepare function * Rename variables with "container" to "frame" in _initializeFrame * Rename variables with "container" to "frame" * Rename getContainer to getFrame * Rename getContainerRect to getFrameRect * Organize and simplify * Fix incorrect change of "popup" => "this" * Move initial _updateVisibility into prepare()
* Text scanner refactor (#517)toasted-nutbread2020-05-08
| | | | | | | | | | | | | | | * Fix return type * Pass search function as a constructor argument * Pass constructor as a details object For consistency with other complex constructors and improved semantics. * Convert _ignorePoints to a single optional function * Organize functions * Rename ignorePoints to ignorePoint
* Popup proxy host refactor (#516)toasted-nutbread2020-05-08
| | | | | | | | | | | | | | | | | | | | | | | * Rename PopupProxyHost to PopupFactory * Update FrontendApiReceiver to support non-async handlers * Make some functions non-async * Make setCustomCss non-async * Make setContentScale non-async * Remove static * Rename variables * Pass frameId into PopupFactory's constructor * Change FrontendApiReceiver source from popup-proxy-host to popup-factor * Rename _invokeHostApi to _invoke * Rename PopupProxy.getHostUrl to getUrl
* Organize frontend functions (#513)toasted-nutbread2020-05-07
|
* Frontend refactor (#508)toasted-nutbread2020-05-06
| | | | | | | | | * Use this.popup instead of this.frontend.popup * Rename Frontend.popup to _popup * Make Frontend functions private * Clean up Frontend constructor
* Text scanning update (#507)toasted-nutbread2020-05-06
| | | | | * Fix unity test missing a parameter * Update docSentenceExtract to not rescan content
* Dom text scanner fixes (#505)toasted-nutbread2020-05-06
| | | | | | | | | * Fix test case * Add test-dom-text-scanner * Ensure that DOMTextScanner._node never becomes null * Add remainder
* Popup init update (#497)toasted-nutbread2020-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add API function to send a message to a specific frameId in a tab * Update _windowMessageHandlers to support additional info per handler * Remove message token * Add new authorization check * Set up new initialization handler * Update initialization * Remove message token * Replace 'prepare' with 'configure' * Create new prepare function * Change configure guard * Log errors in onMessage * Improve popup initialize function * Clear secret/token in _resetFrame * Remove backend message token * Clear src and srcdoc attributes before loading * Don't treat about:blank unloads as load events
* Text selection fixes (#511)siikamiika2020-05-07
| | | | | * select matched text in Frontend.findKanji * blur search query input when setting content
* Extract textSource text inside TextScanner (#500)siikamiika2020-05-05
| | | | | * extract text inside TextScanner * clone textSource before text extraction
* Modifier key profile condition (#487)siikamiika2020-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | * update Frontend options on modifier change * add modifier key profile condition * use select element for modifier condition value * support "is" and "is not" modifier key conditions * use plural * remove dead null check it's never null in that function * pass element on rather than assigning to this * rename event * remove Firefox OS key to Meta detection * hide Meta from dropdown on Firefox * move input type
* DOMTextScanner (#458)toasted-nutbread2020-05-02
| | | | | | | * Create new class for scanning text in a document * Update test styles * Add tests