Showing window after it is fully loaded

OK, I found an answer myself. The proper event is did-finish-load and should be used like this: var Window = new BrowserWindow({ width: 600, height: 400, show: false }); Window.loadUrl(‘file://somefile.html’); Window.webContents.on(‘did-finish-load’, function() { Window.show(); }); For people finding this answer – here you can check official electron documentation on this topic: While loading the page, … Read more

Best practice to use config service in NestJS Module

Update Jan 19 HttpModule.registerAsync() was added in version 5.5.0 with this pull request. HttpModule.registerAsync({ imports:[ConfigModule], useFactory: async (configService: ConfigService) => ({ baseURL: configService.get(‘API_BASE_URL’), timeout: 5000, maxRedirects: 5, }), inject: [ConfigService] }), Original Post This problem was discussed in this issue. For the nestjs modules like the TypeOrmModule or the MongooseModule the following pattern was implemented. … Read more

Problem to use VueI18n outside a component

To use i18n with Vue 3’s composition API, but outside a component’s setup(), you can access its translation API (such as the t function) on its global property. E. g. in a file with unit-testable composition functions: // i18n/index.js import { createI18n } from ‘vue-i18n’ import en from ‘./en.json’ … export default createI18n({ datetimeFormats: {en: … Read more

Facebook-passport with JWT

The best solution I found for that problem would be to redirect to the expected page with a cookie which holds the JWT. Using res.json would only send a json response and would not redirect. That’s why the other suggested answer here would not solve the problem I encountered. So my solution would be: app.get(‘/auth/facebook/callback’, … Read more

What is the difference between `main` and `module` vs `exports` in package.json?

Generally speaking, the “exports” field superseded the “module” field. “module” itself has never been an official standard but it became so widespread that at some point it was a de facto standard. Note that the “module” field is still being used by TypeScript if tsconfig’s moduleResolution is set to node; see microsoft/TypeScript#50794 for more info. … Read more

Trying to render iframe: ancestor violates the following Content Security Policy directive: “frame-ancestors ‘none'”

The frame-ancestors value acts on the source of the iframe not the document framing it. Setting CSP on your page will have no effect on the framing. Think of frame-ancestors like X-Frame-Options on steroids: it restricts what is allowed to frame the content. Gist intentionally does not allow directly framing gists but instead provides a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)