當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript webFrame.setVisualZoomLevelLimits方法代碼示例

本文整理匯總了TypeScript中electron.webFrame.setVisualZoomLevelLimits方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript webFrame.setVisualZoomLevelLimits方法的具體用法?TypeScript webFrame.setVisualZoomLevelLimits怎麽用?TypeScript webFrame.setVisualZoomLevelLimits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在electron.webFrame的用法示例。


在下文中一共展示了webFrame.setVisualZoomLevelLimits方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

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');
webFrame.registerURLSchemeAsBypassingCSP('app');
webFrame.registerURLSchemeAsPrivileged('app');
webFrame.registerURLSchemeAsPrivileged('app', {
	secure: true,
	supportFetchAPI: true,
});
開發者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.setVisualZoomLevelLimits方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。