• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript browser-window.loadURL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中browser-window.loadURL函数的典型用法代码示例。如果您正苦于以下问题:TypeScript loadURL函数的具体用法?TypeScript loadURL怎么用?TypeScript loadURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了loadURL函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: getMainWindow

function getMainWindow() {
    const workAreaSize = require('screen').getPrimaryDisplay().workAreaSize;

    if (!browserWindow) {
        browserWindow = new BrowserWindow({
            'web-preferences': {
                'experimental-features': true,
                'experimental-canvas-features': true,
                'subpixel-font-scaling': true,
                'overlay-scrollbars': true
            },
            resizable: true,
            'min-width': 500,
            'min-height': 300,
            width: workAreaSize.width,
            height: workAreaSize.height,
            show: false
        });

        browserWindow.loadURL('file://' + __dirname + '/../views/index.html');
        menu.setMenu(app, browserWindow);

        browserWindow.on('closed', (): void => browserWindow = null);

        browserWindow.webContents.on('did-finish-load', () => {
            browserWindow.show();
            browserWindow.focus();
        });
    }

    return browserWindow;
}
开发者ID:digideskio,项目名称:black-screen,代码行数:32,代码来源:Main.ts


示例2: function

app.on('ready', function() {
  mainWindow = new BrowserWindow({width: 800, height: 600});
  mainWindow.loadURL('file://' + __dirname + '/../html/index.html');
  mainWindow.on('closed', function() {
    mainWindow = null;
  });
})
开发者ID:KenjiOhtsuka,项目名称:brief-spread,代码行数:7,代码来源:main.ts


示例3: getMainWindow

function getMainWindow(): Electron.BrowserWindow {
    const screen: Electron.Screen = require("screen");
    const workAreaSize = screen.getPrimaryDisplay().workAreaSize;

    if (!browserWindow) {
        let options: Electron.BrowserWindowOptions = {
            webPreferences: {
                experimentalFeatures: true,
                experimentalCanvasFeatures: true,
            },
            titleBarStyle: "hidden",
            resizable: true,
            minWidth: 500,
            minHeight: 300,
            width: workAreaSize.width,
            height: workAreaSize.height,
            show: false,
        };
        browserWindow = new browserWindowConstructor(options);

        browserWindow.loadURL("file://" + __dirname + "/../views/index.html");
        menu.setMenu(app, browserWindow);

        browserWindow.on("closed", (): void => browserWindow = undefined)
                     .on("focus", (): void => app.dock && app.dock.setBadge(""));

        browserWindow.webContents.on("did-finish-load", () => {
            browserWindow.show();
            browserWindow.focus();
        });
    }

    return browserWindow;
}
开发者ID:bj7,项目名称:black-screen,代码行数:34,代码来源:Main.ts


示例4: function

app.on('ready', function() {

    loadingWindow = new BrowserWindow({
        width: 600,
        height: 200,
        titleBarStyle: 'hidden',
        frame: false,
        resizable: false,
        movable: false,
        minimizable: false,
        maximizable: false,
    });

    loadingWindow.loadURL('file://' + __dirname + '/views/loader.html');

    ldm.download().then((d)=>{
        console.log('etape1')
        ldm.parse().then((datas)=>{
            console.log('etape2')
            ldm.populate(datas).then(()=>{
                console.log('etape3')
                startApp();
            })
        });
    }).fail((d)=>{
        fs.stat(ldm.xmlFileLocal, function(err, stats){
            if( err ) {
                dialog.showMessageBox(loadingWindow, {
                    type: 'error',
                    buttons: ['ok'],
                    message: 'Impossible de rĂŠcupĂŠrer les informations distante, ressayer plus tard.'
                }, function(d){
                    loadingWindow.destroy();
                    app.quit();
                });
            } else {
                loadingWindow.destroy();
                startApp();
            }
        })
    });



});
开发者ID:Heolink,项目名称:ldm,代码行数:45,代码来源:index.ts


示例5: BrowserWindow

app.on('ready', () => {

  // Initialize the window to our specified dimensions
  mainWindow = new BrowserWindow({ width: 900, height: 620 });

  // Tell Electron where to load the entry point from
  mainWindow.loadURL('file://' + __dirname + '/index.html');

  // Clear out the main window when the app is closed
  mainWindow.on('closed', () => {
    mainWindow = null;
  });

  mainWindow.webContents.on('did-navigate-in-page', (e: any, url: string) => {
    console.log(`Page navigated: ${url}`);
  });  

  let appTitle: string = `Angular 2 Seed Advanced`;  

  let langMenu: any = {
    label: 'Language',
    submenu: []
  };
  for (let lang of AppConfigService.SUPPORTED_LANGUAGES) {
    let langOption = {
      label: lang.title,
      click:() => {
        console.log(`Change lang: ${lang.code}`);
        mainWindow.webContents.executeJavaScript(`window.dispatchEvent(new CustomEvent('changeLang', {detail: { value: '${lang.code}'} }));`);
      }
    };
    langMenu.submenu.push(langOption);
  }

  let helpMenu: any = {
    label: 'Help',
    submenu: [{
      label: 'Learn More',
      click:() => {
        shell.openExternal('https://github.com/NathanWalker/angular2-seed-advanced');
      }
    }, {
        label: 'Issues',
        click:() => {
          shell.openExternal('https://github.com/NathanWalker/angular2-seed-advanced/issues');
        }
      }, {
        label: `My Amazing Parent: Minko Gechev's Angular 2 Seed`,
        click:() => {
          shell.openExternal('https://github.com/mgechev/angular2-seed');
        }
      }, {
        label: 'Angular 2',
        click:() => {
          shell.openExternal('https://angular.io/');
        }
      }, {
        label: 'Electron',
        click:() => {
          shell.openExternal('http://electron.atom.io/');
        }
      }, {
        label: 'Electron Docs',
        click: () => {
          shell.openExternal('https://github.com/atom/electron/tree/master/docs');
        }
      }, {
        label: 'Codeology Visualization',
        click:() => {
          shell.openExternal('http://codeology.braintreepayments.com/nathanwalker/angular2-seed-advanced');
        }
      }]
  };  

  if (process.platform === 'darwin') {
    template = [{
      label: appTitle,
      submenu: [{
        label: `About ${appTitle}`,
        selector: 'orderFrontStandardAboutPanel:'
      }, {
          type: 'separator'
        }, {
          label: 'Services',
          submenu: []
        }, {
          type: 'separator'
        }, {
          label: 'Hide Angular 2 Seed Advanced',
          accelerator: 'Command+H',
          selector: 'hide:'
        }, {
          label: 'Hide Others',
          accelerator: 'Command+Shift+H',
          selector: 'hideOtherApplications:'
        }, {
          label: 'Show All',
          selector: 'unhideAllApplications:'
        }, {
          type: 'separator'
//.........这里部分代码省略.........
开发者ID:TheLarkInn,项目名称:angular2-seed-advanced,代码行数:101,代码来源:main.desktop.ts



注:本文中的browser-window.loadURL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript browser-window.loadUrl函数代码示例发布时间:2022-05-25
下一篇:
TypeScript browser-window.close函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap