本文整理汇总了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');
示例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)