Fixes
This commit is contained in:
		
							parent
							
								
									3f8d84803c
								
							
						
					
					
						commit
						450dadb486
					
				@ -89,7 +89,7 @@
 | 
				
			|||||||
                </select>
 | 
					                </select>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </modal>
 | 
					        </modal>
 | 
				
			||||||
        <modal :buttons="false" ref="wordDefinitionViewer" dialogClass="w-100 word-definition-viewer">
 | 
					        <modal :buttons="false" ref="wordDefinitionViewer" dialogClass="word-definition-viewer">
 | 
				
			||||||
            <word-definition :expression="wordDefinitionLookup" ref="wordDefinitionLookup"></word-definition>
 | 
					            <word-definition :expression="wordDefinitionLookup" ref="wordDefinitionLookup"></word-definition>
 | 
				
			||||||
            <template slot="title">
 | 
					            <template slot="title">
 | 
				
			||||||
                {{wordDefinitionLookup}}
 | 
					                {{wordDefinitionLookup}}
 | 
				
			||||||
@ -671,7 +671,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    .word-definition-viewer {
 | 
					    .word-definition-viewer {
 | 
				
			||||||
      .modal-content {
 | 
					      .modal-content {
 | 
				
			||||||
        min-height: 60%;
 | 
					        min-height: 75%;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      .definition-wrapper {
 | 
					      .definition-wrapper {
 | 
				
			||||||
 | 
				
			|||||||
@ -105,10 +105,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            log.debug('init.window.languages');
 | 
					            log.debug('init.window.languages');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            await this.addTab();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            log.debug('init.window.tab');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            electron.ipcRenderer.on('settings', (_e: Event, settings: GeneralSettings) => {
 | 
					            electron.ipcRenderer.on('settings', (_e: Event, settings: GeneralSettings) => {
 | 
				
			||||||
                this.settings = settings;
 | 
					                this.settings = settings;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -116,7 +112,10 @@
 | 
				
			|||||||
                log.transports.console.level = settings.risingSystemLogLevel;
 | 
					                log.transports.console.level = settings.risingSystemLogLevel;
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            electron.ipcRenderer.on('rising-upgrade-complete', () => { this.hasCompletedUpgrades = true; });
 | 
					            electron.ipcRenderer.on('rising-upgrade-complete', () => {
 | 
				
			||||||
 | 
					              // console.log('RISING COMPLETE RECV');
 | 
				
			||||||
 | 
					              this.hasCompletedUpgrades = true;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
            electron.ipcRenderer.on('allow-new-tabs', (_e: Event, allow: boolean) => this.canOpenTab = allow);
 | 
					            electron.ipcRenderer.on('allow-new-tabs', (_e: Event, allow: boolean) => this.canOpenTab = allow);
 | 
				
			||||||
            electron.ipcRenderer.on('open-tab', () => this.addTab());
 | 
					            electron.ipcRenderer.on('open-tab', () => this.addTab());
 | 
				
			||||||
            electron.ipcRenderer.on('update-available', (_e: Event, available: boolean) => this.hasUpdate = available);
 | 
					            electron.ipcRenderer.on('update-available', (_e: Event, available: boolean) => this.hasUpdate = available);
 | 
				
			||||||
@ -172,6 +171,13 @@
 | 
				
			|||||||
            document.addEventListener('click', () => this.activeTab!.view.webContents.focus());
 | 
					            document.addEventListener('click', () => this.activeTab!.view.webContents.focus());
 | 
				
			||||||
            window.addEventListener('focus', () => this.activeTab!.view.webContents.focus());
 | 
					            window.addEventListener('focus', () => this.activeTab!.view.webContents.focus());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            log.debug('init.window.listeners');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            await this.addTab();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            log.debug('init.window.tab');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // console.log('SORTABLE', Sortable);
 | 
					            // console.log('SORTABLE', Sortable);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Sortable.create(<HTMLElement>this.$refs['tabs'], {
 | 
					            Sortable.create(<HTMLElement>this.$refs['tabs'], {
 | 
				
			||||||
 | 
				
			|||||||
@ -238,7 +238,8 @@ function createWindow(): Electron.BrowserWindow | undefined {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            // Temp fix -- manually override adblocker's preload script
 | 
					            // Temp fix -- manually override adblocker's preload script
 | 
				
			||||||
            // to point to CJS  that has been copied over with config in webpack.config.js
 | 
					            // to point to CJS  that has been copied over with config in webpack.config.js
 | 
				
			||||||
            const preloadScript = './preview/assets/adblocker/preload.cjs.js'; // require.resolve('@cliqz/adblocker-electron-preload');
 | 
					            // require.resolve('@cliqz/adblocker-electron-preload');
 | 
				
			||||||
 | 
					            const preloadScript =  path.join(electron.app.getAppPath(), './preview/assets/adblocker/preload.cjs.js');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // const originPath = require.resolve('@cliqz/adblocker-electron-preload');
 | 
					            // const originPath = require.resolve('@cliqz/adblocker-electron-preload');
 | 
				
			||||||
            // const preloadScript = path.resolve(path.dirname(originPath), 'preload.cjs.js');
 | 
					            // const preloadScript = path.resolve(path.dirname(originPath), 'preload.cjs.js');
 | 
				
			||||||
@ -652,6 +653,7 @@ function onReady(): void {
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    electron.ipcMain.on('rising-upgrade-complete', () => {
 | 
					    electron.ipcMain.on('rising-upgrade-complete', () => {
 | 
				
			||||||
 | 
					        // console.log('RISING COMPLETE SHARE');
 | 
				
			||||||
        hasCompletedUpgrades = true;
 | 
					        hasCompletedUpgrades = true;
 | 
				
			||||||
        for(const w of electron.webContents.getAllWebContents()) w.send('rising-upgrade-complete');
 | 
					        for(const w of electron.webContents.getAllWebContents()) w.send('rising-upgrade-complete');
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
				
			|||||||
@ -44,15 +44,14 @@ export default class WordDefinition extends Vue {
 | 
				
			|||||||
  mounted(): void {
 | 
					  mounted(): void {
 | 
				
			||||||
    const webview = this.getWebview();
 | 
					    const webview = this.getWebview();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    webview.addEventListener(
 | 
					    const eventProcessor = async (event: EventBusEvent): Promise<void> => {
 | 
				
			||||||
        'update-target-url', // 'did-navigate', // 'dom-ready',
 | 
					        const js = this.wrapJs(this.getMutator(this.mode));
 | 
				
			||||||
        (event: EventBusEvent) => {
 | 
					 | 
				
			||||||
            const js = this.wrapJs(this.getMutator(this.mode));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // tslint:disable-next-line
 | 
					        return this.executeJavaScript(js, event);
 | 
				
			||||||
            this.executeJavaScript(js, event);
 | 
					    };
 | 
				
			||||||
        }
 | 
					
 | 
				
			||||||
    );
 | 
					    webview.addEventListener('update-target-url', eventProcessor);
 | 
				
			||||||
 | 
					    webview.addEventListener('dom-ready', eventProcessor);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -62,6 +61,10 @@ export default class WordDefinition extends Vue {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getWebUrl(): string {
 | 
					  getWebUrl(): string {
 | 
				
			||||||
 | 
					    if (!this.expression) {
 | 
				
			||||||
 | 
					      return 'about:blank';
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch(this.mode) {
 | 
					    switch(this.mode) {
 | 
				
			||||||
      case 'dictionary':
 | 
					      case 'dictionary':
 | 
				
			||||||
        return `https://www.dictionary.com/browse/${encodeURI(this.getCleanedWordDefinition())}`;
 | 
					        return `https://www.dictionary.com/browse/${encodeURI(this.getCleanedWordDefinition())}`;
 | 
				
			||||||
 | 
				
			|||||||
@ -1,31 +1,31 @@
 | 
				
			|||||||
class FChatDefinitionMutator {
 | 
					class FChatDefinitionMutator {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    mutateDictionary() {
 | 
					    mutateDictionary() {
 | 
				
			||||||
        document.querySelectorAll('html')[0].setAttribute('style', 'border: 0 !important; padding: 0 !important; margin: 0 !important;');
 | 
					        document.querySelectorAll('html, body').forEach(e => e.setAttribute('style', 'border: 0 !important; padding: 0 !important; margin: 0 !important;'));
 | 
				
			||||||
        document.querySelectorAll('body')[0].setAttribute('style', 'border: 0 !important; padding: 0 !important; margin: 0 !important;');
 | 
					        document.querySelectorAll('.app-base').forEach(e => e.setAttribute('style', 'padding: 0 !important; margin: 0 !important;'));
 | 
				
			||||||
        document.querySelectorAll('.app-base')[0].setAttribute('style', 'padding: 0 !important; margin: 0 !important;');
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        document.querySelectorAll('header, footer, .serp-nav-button, aside, .sailthru-overlay-container, .bxc, #marketingBanner-right, #marketingBanner-right-button')
 | 
					        document.querySelectorAll('header, footer, .serp-nav-button, aside, .sailthru-overlay-container, .bxc, #marketingBanner-right, #marketingBanner-right-button')
 | 
				
			||||||
            .forEach(e => e.setAttribute('style', 'display: none !important'));
 | 
					            .forEach(e => e.setAttribute('style', 'display: none !important'));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
        const headword = document.querySelector('.entry-headword');
 | 
					        const headword = document.querySelector('.entry-headword');
 | 
				
			||||||
        const parent = headword.parentElement.parentElement;
 | 
					 | 
				
			||||||
        let el = headword.parentElement.nextElementSibling;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        while (el) {
 | 
					        if (headword) {
 | 
				
			||||||
            const dEl = el;
 | 
					            const parent = headword.parentElement.parentElement;
 | 
				
			||||||
 | 
					            let el = headword.parentElement.nextElementSibling;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            el = el.nextElementSibling;
 | 
					            while (el) {
 | 
				
			||||||
            parent.removeChild(dEl);
 | 
					                const dEl = el;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                el = el.nextElementSibling;
 | 
				
			||||||
 | 
					                parent.removeChild(dEl);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    mutateThesaurus() {
 | 
					    mutateThesaurus() {
 | 
				
			||||||
        document.querySelectorAll('html')[0].setAttribute('style', 'border: 0 !important; padding: 0 !important; margin: 0 !important;');
 | 
					        document.querySelectorAll('html, body').forEach(e => e.setAttribute('style', 'border: 0 !important; padding: 0 !important; margin: 0 !important;'));
 | 
				
			||||||
        document.querySelectorAll('body')[0].setAttribute('style', 'border: 0 !important; padding: 0 !important; margin: 0 !important;');
 | 
					        document.querySelectorAll('.app-base').forEach(e => e.setAttribute('style', 'padding: 0 !important; margin: 0 !important;'));
 | 
				
			||||||
        document.querySelectorAll('.app-base')[0].setAttribute('style', 'padding: 0 !important; margin: 0 !important;');
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        document.querySelectorAll('header, footer, .serp-nav-button, aside, button, .sailthru-overlay-container, .bxc, #marketingBanner-right, #marketingBanner-right-button')
 | 
					        document.querySelectorAll('header, footer, .serp-nav-button, aside, button, .sailthru-overlay-container, .bxc, #marketingBanner-right, #marketingBanner-right-button')
 | 
				
			||||||
            .forEach(e => e.setAttribute('style', 'display: none !important'));
 | 
					            .forEach(e => e.setAttribute('style', 'display: none !important'));
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user