草庐IT

cordova-plugin-background-mode

全部标签

javascript - 使用 webpack-dev-server 时,html-webpack-plugin 不会将 js 文件注入(inject) index.html

这是我的webpack配置:varpath=require('path');varwebpack=require('webpack')varHtmlWebpackPlugin=require('html-webpack-plugin')varfs=require('fs'),buildPath='./dist/';varfolder_exists=fs.existsSync(buildPath);if(folder_exists==true){require('shelljs/global')rm('-rf','dist')};module.exports={entry:'./src/

javascript - 如何消除 Phaser 的 Sprite/Background 的抖动

我设置了一个例子jsfiddle用适当的Assets来说明这一点。当您的Angular色移动并且相机开始平移时,您会注意到背景有轻微的“抖动”。这可以通过将game.camera.roundPx设置为true来禁用。但是,如果它被禁用并且你移动了Angular色。你的性格开始颤抖。我在这次冒险中发现的一些东西:只有在P2和Arcade物理条件下使用body.velocity.x移动时才会发生这种情况。如果您使用body.x或仅使用x移动Angular色,那绝对没问题。如果移除tilemap纹理,您可以从字面上看到移动时眼睛发生的抖动。Examplehere--确保你移动的距离足以让相机

javascript - Background.js 无法正常工作 Chrome 扩展

我是chrome扩展的新手,似乎无法弄清楚背景概念是如何工作的。我正在构建一个计数器扩展,即使当用户关闭扩展(而不是浏览器)并想做一个简单的测试,看看我是否能弄清楚如何使用后台文件时,它也会继续计数。下面是我尝试创建一个功能,每次用户单击一个选项卡(在我的扩展程序之外)时激活该功能,当他们单击5个选项卡时,警报会触发。我不明白为什么这不起作用。背景.js:varcounter=0;chrome.browserAction.onClicked.addListener(function(tab){counter++;if(counter==5){alert("Hi");}});list.j

javascript - Douglas Crockford 的 Strict Mode Example 是不是错了?

我敢肯定他不是。我只是不明白他的演讲中的一个例子http://youtu.be/UTEqr0IlFKY?t=44mfunctionin_strict_mode(){return(function(){return!this;}());}这不也一样吗?functionin_strict_mode(){return!this;}如果is_strict_mode()是method那么我同意,因为this然后会指向包含方法的对象,例如my_object.in_strict_mode=function(){return(function(){return!this;}());}但为什么他在他的示

c# - 如何从 C# 调用 JavaScript - Cordova/PhoneGap

我正在使用cordova/phonegap制作WindowsPhone应用程序,我正在尝试在事件触发时从C#调用脚本。有什么办法吗?这是我目前的类(class)。publicvoidregister(stringoptions){//Thisisexecutedasynchronouslyif(!TryFindChannel())DoConnect();}voidhttpChannel_ChannelUriUpdated(objectsender,NotificationChannelUriEventArgse){//Finishedasynchronoustaskin"registe

javascript - Visual Studio 任务运行程序 "SyntaxError: Use of const in strict mode."

将Win10Pro/VS2015与“网站”项目(不是asp.net,基本网站)一起使用当尝试保存/重新加载gulpfile.js时,我收到错误消息(来自TaskRunnerExplorer/输出)SyntaxError:Useofconstinstrictmode.在目前的情况下,它因“gulp-changed”而窒息我已查看可用的答案和评论:SyntaxError:UseofconstinstrictmodeSyntaxError:Useofconstinstrictmode?我已经将我的Node版本更新到最新版本:6.10.30我已经清理了缓存(npmcacheclean-f)我使

javascript - 为 Angular JS 启用 html 5 模式会抛出 JS 错误 : Failed to instantiate module due to: TypeError: Cannot read property 'html5Mode' of undefined

如何为AngularJS启用html5模式?'usestrict'varblogApp=angular.module('blogApp',['ngRoute']).config(['$routeProvider',function($routeProvider,$locationProvider){$routeProvider.when('/disclaimer',{templateUrl:'templates/disclaimer.html',controller:'DisclaimerCtrl'});$routeProvider.otherwise({redirectTo:'/'}

javascript - Cordova FileEntry 无法返回文件 -> FILE_NOT_FOUND_ERR

我正在尝试从iOS文件系统获取文件。我的文件位于:console.log(PATH);-->file:///var/mobile/Applications/B816F30B-791A-43E5-B33A-A26075E8B585/Documents/123123123.wav现在我正尝试通过文件API获取文件window.resolveLocalFileSystemURL(PATH,function(fileEntry){console.log(fileEntry.fullPath);///var/mobile/Applications/B816F30B-791A-43E5-B33A-

javascript - cordova/angular/ionic 堆栈中的某些东西偷走了我的注意力

为了提供辅助功能,我需要在我的Cordova应用程序中进入屏幕时聚焦元素。通过一些技巧,我设法将焦点设置在一个元素上,但该元素会立即失去焦点(通过监听“模糊”事件验证)并且丢失发生在ApplesVoiceOver、AndroidsTalkback启动或用户可以接受之前任何Action。我已经尝试将焦点设置包装在$timeout内,以强制它在渲染完所有内容后发生,但这根本没有帮助。在我看来,Cordova中的某些东西,angular1或ionic会在其自身干扰m代码时产生一些令人讨厌的聚焦魔法。有没有人经历过类似的事情并找到了解决方法? 最佳答案

javascript - 热点插件 scanWifi() 在 Android ionic cordova 中不起作用

我在扫描最近的wifi时遇到问题。我正在使用ionicCordova框架。我使用了Hotspot插件的scanWifi方法来扫描wifi列表。我引用了以下链接:https://ionicframework.com/docs/native/hotspot/我的代码是:import{Hotspot,HotspotNetwork}from'@ionic-native/hotspot';this.hotspot.scanWifi().then((networks:Array)=>{this.availableWifiList=networks;});当应用程序尝试扫描最近的wifi时,它会返回