当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript webFrame.setZoomFactor方法代码示例

本文整理汇总了TypeScript中electron.webFrame.setZoomFactor方法的典型用法代码示例。如果您正苦于以下问题:TypeScript webFrame.setZoomFactor方法的具体用法?TypeScript webFrame.setZoomFactor怎么用?TypeScript webFrame.setZoomFactor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在electron.webFrame的用法示例。


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

示例1:

		console.log(err);
	});
});

remote.getCurrentWebContents().print();

remote.getCurrentWindow().capturePage(buf => {
	remote.require('fs').writeFile('/tmp/screenshot.png', buf, (err: Error) => {
		console.log(err);
	});
});

// web-frame
// https://github.com/atom/electron/blob/master/docs/api/web-frame.md

webFrame.setZoomFactor(2);
console.log(webFrame.getZoomFactor());

webFrame.setZoomLevel(200);
console.log(webFrame.getZoomLevel());

webFrame.setVisualZoomLevelLimits(50, 200);
webFrame.setLayoutZoomLevelLimits(50, 200);

webFrame.setSpellCheckProvider('en-US', true, {
	spellCheck: text => {
		return !(require('spellchecker').isMisspelled(text));
	}
});

webFrame.registerURLSchemeAsSecure('app');
开发者ID:longlho,项目名称:DefinitelyTyped,代码行数:31,代码来源:github-electron-renderer-tests.ts

示例2: getLogger

 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 *
 */

import {IpcMessageEvent, WebviewTag, ipcRenderer, webFrame} from 'electron';
import {EVENT_TYPE} from '../lib/eventType';
import * as locale from '../locale/locale';
import {getLogger} from '../logging/getLogger';
import * as EnvironmentUtil from '../runtime/EnvironmentUtil';
import {AutomatedSingleSignOn} from '../sso/AutomatedSingleSignOn';

const logger = getLogger('preload');

webFrame.setZoomFactor(1.0);
webFrame.setVisualZoomLevelLimits(1, 1);

window.locStrings = locale.LANGUAGES[locale.getCurrent()];
window.locStringsDefault = locale.LANGUAGES.en;

window.isMac = EnvironmentUtil.platform.IS_MAC_OS;

const getSelectedWebview = (): WebviewTag => document.querySelector('.Webview:not(.hide)') as WebviewTag;
const getWebviewById = (id: string): WebviewTag => {
  return document.querySelector(`.Webview[data-accountid="${id}"]`) as WebviewTag;
};

const subscribeToMainProcessEvents = () => {
  ipcRenderer.on(EVENT_TYPE.ACCOUNT.SSO_LOGIN, (event: IpcMessageEvent, code: string) =>
    new AutomatedSingleSignOn().start(code)
开发者ID:wireapp,项目名称:wire-desktop,代码行数:31,代码来源:preload.ts


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