草庐IT

Extension

全部标签

c# - 使用反射检查方法是否为 "Extension Method"

作为我的应用程序的一部分,我有一个接收MethodInfo的函数,并且需要根据该方法是否为“扩展方法”对其执行特定操作。我检查了MethodInfo类,但找不到任何显示该方法是扩展的IsExtension属性或标志。有谁知道如何从方法的MethodInfo中找到它? 最佳答案 您可以在MethodInfo实例上调用IsDefined方法,通过检查ExtensionAttribute是否应用于该方法来找出这一点:boolisExtension=someMethod.IsDefined(typeof(ExtensionAttribute

javascript - Google Chrome Extension 获取页面信息

我正在制作一个googlechrome扩展程序,我需要获取当前页面的URL和标题。我怎样才能做到这一点? 最佳答案 chrome.tabs.getSelected(null,function(tab){//更多请阅读chrome.tabs.关于tab对象,阅读here.注意:chrome.tabs.getSelectedhasbeendeprecatedsinceChrome16.正如文档所建议的那样,chrome.tabs.query()应与参数{'active':true}一起使用以选择事件选项卡。chrome.tabs.que

javascript - native 原型(prototype)与 $.extension()

在工作中,我们使用jQuery。在我们开始使用它后不久,我看到几个开发人员正在向文件jquery-extensions.js添加函数。在内部,我发现添加到$的一大堆方法基本上相当于jQuery上的静态方法。这里有一些:$.formatString(str,args){...}$.objectToArray(obj){...}等等。它们实际上都没有使用任何与jQuery相关的东西。这让我觉得很奇怪。最终,我们的库中需要一个函数来本地化日期。我的解决方案是创建:Date.prototype.toLocaleDate=function(){...}Date.parseLocalDate=fu

javascript - Chrome 扩展已禁用 "This extension may have been corrupted"Chrome 63.0.3239.84

我有一个专用的Chrome扩展程序,它可以打开一个文本框并使用文本框中的输入在新标签页中打开URL。在上周末Chrome更新提示新的“此扩展程序可能已损坏”错误之前,它一直运行良好。在Windows上,Chrome将禁用该扩展程序,在OSX上,它会使Chrome崩溃。在两者上,加载解压的扩展都可以正常工作,只有当它被打包到.crx中时才会提示错误。据我所知,没有拼写错误的文件路径。可能是什么问题?list.json{"browser_action":{"default_icon":"multi_search.png","default_popup":"multi_search.html

javascript - 需要 jsx 文件而不指定扩展名

我正在使用browserify和watchify,并且想要require()文件而不是默认扩展名.js和.json不指定扩展名,例如://Notideal(tedious)varCarousel=require('./components/Carousel/Carousel.jsx')//IdealvarCarousel=require('./components/Carousel/Carousel')我已经按照browserify文档中的说明尝试了--extension=EXTENSION:"scripts":{"build":"browserify./src/App.js--tra

javascript - Chrome 扩展 : have an extension listen for an event on a page?

我有一个为我的网站制作的chrome扩展程序,目前我有一个扩展程序每分钟检查一次数据库以获取更新。是否可以让扩展程序监听实际页面上的事件?像这样this.trigger('sendUpdate',data)//thishappenedonthepagethis.on(sendUpdate,function(){//thisiswhatthechromeextensionlistensfor//dostuffwithdata}) 最佳答案 您需要添加一个content_script。content_script具有对DOM的完全访问权

php - FFmpeg - PHP 错误代码 127

我正在尝试从php执行FFmpeg。我已经安装了FFmpeg-php,扩展位于模块目录中,它显示在phpinfo中。FFmpeg工作正常,因为我可以在终端中运行命令并输出视频。但是,当我尝试使用以下脚本从php运行命令时:exec(ffmpeg-iinput.avioutput.avi);但我收到“127”错误代码。扩展加载使用:$extension="ffmpeg";$extension_soname=$extension.".".PHP_SHLIB_SUFFIX;$extension_fullname=PHP_EXTENSION_DIR."/".$extension_soname;

javascript - XMLHttpRequest;跨源请求仅支持协议(protocol)方案 : http, data, chrome, chrome-extension, https, chrome-extension-resource

这个问题在这里已经有了答案:"CrossoriginrequestsareonlysupportedforHTTP."errorwhenloadingalocalfile(30个答案)关闭3年前。当我尝试进行ajax调用时,我在chrome上收到以下错误。XMLHttpRequestcannotloadjavascript:;.Crossoriginrequestsareonlysupportedforprotocolschemes:http,data,chrome,chrome-extension,https,chrome-extension-resource.代码如下:$.ajax

php - 如何在 Ubuntu 上安装这些 PHP 扩展?

这个问题在这里已经有了答案:HowtoinstallallrequiredPHPextensionsforLaravel?(5个答案)关闭2年前。Ubuntu16.04。nginx版本:nginx/1.10.0(Ubuntu)PHP7.0.8-0ubuntu0.16.04.3当我在Magento2目录中运行composerinstall-v时,我得到了这个:LoadingcomposerrepositorieswithpackageinformationInstallingdependencies(includingrequire-dev)fromlockfileDependencyr

php - 'php_sqlsrv_56_ts.dll'扩展文件存在但是php.ini中没有 'extension=php_sqlsrv_56_ts.dll'行

我正在尝试将sql-server与php一起使用。我从thisunofficialsite下载了64位php_pdo_sqlsrv_56_ts.dll和php_sqlsrv_56_ts.dll.我把dll文件解压到D:\wamp64\bin\php\php5.6.31\ext。在php.ini中,我添加了以下行并重新启动了WAMP:[PHP_SQLSRV]extension=php_sqlsrv_56_ts.dll[PHP_PDO_SQLSRV]extension=php_pdo_sqlsrv_56_ts.dll在WAMP>php>extensions中,它向我展示了这个:单击这些扩展