diff options
Diffstat (limited to 'app/src/main/assets/js/search.js')
-rw-r--r-- | app/src/main/assets/js/search.js | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/app/src/main/assets/js/search.js b/app/src/main/assets/js/search.js index 5f0f0e0a..0a8954ef 100644 --- a/app/src/main/assets/js/search.js +++ b/app/src/main/assets/js/search.js @@ -1,16 +1,19 @@ //binds callbacks to an invisible webview to take in the search events -console.log('Binding Search'); -var _f_page = document.querySelector('#page'); -// var _f_input = document.querySelector('#main-search-input') -if (!_f_page) Frost.emit(1); -// else { - Frost.emit(0); - var x = new MutationObserver(function(mutations) { - Frost.handleHtml(page.innerHTML); - Frost.emit(2); - }); - x.observe(_f_page, { - childList: true, - subtree: true - }); -// } +if (!window.hasOwnProperty('frost_search')) { + console.log('Registering frost_search'); + window.frost_search = true; + var _f_page = document.querySelector('#page'); + // var _f_input = document.querySelector('#main-search-input') + if (!_f_page) Frost.emit(1); + else { + Frost.emit(0); + var x = new MutationObserver(function(mutations) { + Frost.handleHtml(page.innerHTML); + Frost.emit(2); + }); + x.observe(_f_page, { + childList: true, + subtree: true + }); + } +} |