OpenService Accelerators Developer Guide.docx
- 文档编号:15649895
- 上传时间:2023-07-06
- 格式:DOCX
- 页数:15
- 大小:82.47KB
OpenService Accelerators Developer Guide.docx
《OpenService Accelerators Developer Guide.docx》由会员分享,可在线阅读,更多相关《OpenService Accelerators Developer Guide.docx(15页珍藏版)》请在冰点文库上搜索。
OpenServiceAcceleratorsDeveloperGuide
OpenServiceAcceleratorsDeveloperGuide
InWindowsInternetExplorer 8,AcceleratorsarecontextualmenuoptionsthatcanquicklyaccessapplicationsorWebservicesfromanyWebpage.UserscaninstallAcceleratorsfromtheInternetExplorer8ServiceGallery
orthroughanyWebsitethatadvertisesthem.AcceleratorsmakeiteasiertocopyinformationfromoneWebpagetoanother.ThisarticledescribeshowtodefineanddeployXML-basedAccelerators.
Thisarticlecontainsthefollowingsections:
∙KeyPoints
∙Introduction
∙Categories
∙Variables
oURLTemplateParameters
oForm-basedParameters
oSelectionTypes
oSecurityImplicationsofDocumentVariables
∙Preview
oSize
oContent
oNavigation
∙Localization
oEnglishExample
oSpanishExample
∙Installation
∙OpenServiceAcceleratorFormat
∙RelatedTopics
KeyPoints
∙Acceleratorsappearontheright-clickshortcutmenuoftheWebpageinInternetExplorer 8.Theyaregroupedbyfunctionsothatuserscanquicklyaccessthetaskthattheywant.
∙Acceleratorsenabletwotypesofscenarios:
userscan"preview"informationwithoutleavingaWebpageor"execute"tosendcontentdirectlytoanapplicationorWebservice.
∙AnXML-basedAcceleratorusesXMLfiletodescribetheformatofHTTPrequeststotheWebserver.Datafromthetargetcontext(selection,link,ordocument)ispassedasvariablesinURLparametersand/orformdata.
∙ToinstallXML-basedAcceleratorsfromaWebsite,usethewindow.external.AddServicemethodtoprompttheuser.
Introduction
AcceleratorsletyouactondatainaWebpage.Youcanselectafewlinesoftextandsendittoablogoremailitwithaclick.UsingapreviouslyinstalledAccelerator,thisaction"executes"thedesiredactivitybynavigatingtothedesiredWebsitewiththeselectedportionofthearticlealreadyavailableintheeditfield.YoucanalsoactondatawithoutgoingtoanotherWebsiteusing"preview"Accelerators;forexample,youcantranslateawordormapanaddress.HoveroveranAcceleratorwithyourmousetoviewthepreviewwindow,asshowninthefollowingscreenshot.
Figure1:
MappinganaddresswithapreviewAccelerator.
Acceleratorsaredeclarative.TheyuseHTTPsubmissiontocommunicatebetweenthebrowserandtheWebsite.XML-basedAcceleratorsareeasytocreate,test,anddeploytousers.
Categories
Acceleratorsaregroupedbyfunctionsothatuserscanquicklyaccessthetaskthattheywant.YoucansetthedefaultAcceleratorforagivencategorywhenyouinstalltheAcceleratororthroughtheManageAdd-onsdialogbox.
Examplesofservicesthatexisttoday:
∙Add:
del.icio.us,Digg,Reddit
∙Blog:
WindowsLiveSpaces,WindowsLiveWriter,Blogger
∙Define:
Encarta,Wikipedia,D
∙Map:
WindowsLiveMap,GoogleMaps,Yahoo!
Maps,MapQuest
∙Send:
WindowsLiveMail,GoogleMail,Yahoo!
∙Translate:
WindowsLiveTranslation,AltaVista'sBabelFish,GoogleTranslation
IftheAcceleratordoesn'tfitarecommendedcategory,youcandefineyourown.
复制
activitycategory="Share"> ThecategoryshouldbeaverbthattheusercanrecognizeandisnottiedtoaspecificbrandorapplicationsootherAcceleratorsofsimilarfunctionalitycanusethecategory.Additionally,becausethevalueofthecategoryattributeisusedbyManageAdd-onstoorganizeAcceleratorsingroups,itshouldbehuman-readableandcapitalizedappropriately. Variables DocumentpropertiesandcontentaresenttotheAcceleratorserviceproviderthroughHTTPGETand/orPOSTsubmissions.ThesepropertiesareexpressedasreplacementvariablesthatcanbepassedasformfieldsorasURLparameters.Variablescanbespecifieddirectlyintheactionattributeofos: executeandos: preview(calleda"URLtemplate"),orwithinos: parameterelements. Note Youcanusecookiestostorestateandusercredentials. Thefollowingvariablesareavailable: Variable Context Description {documentUrl} All† Thehrefofthedocument. {documentTitle} All Thetitleofthedocument,ifavailable. {documentDomain} All Effectivesecond-leveldomainfromthedocument'shref. {documentHost} All Fullyqualifieddomainfromthedocument'shref. {selection} selection Currentlyselectedtext. {link} link Thehrefoftheselectedlink. {linkText} link TheinnerTextoftheselectedlink. {linkRel} link Thereloftheselectedlink,ifavailable. {linkType} link Thetypeoftheselectedlink,ifavailable. {linkDomain} link Effectivesecond-leveldomainfromthelink'shref. {linkHost} link Fullyqualifieddomainfromthelink'shref. †Notavailableduringpreviewoutsideofdocumentcontext. Afewthingstorememberaboutvariables: ∙Alwaysenclosevariablenamesincurlybraces{};forexample{selection}.Tospecifyaliteralcurlybracecharacterintherequest,escapeitwithabackslash,suchas\{{selection}\}. ∙Placinga"? "afterthevariablenameindicatesthatitisoptional;forexample,{documentTitle? }. ∙Ifanyrequired(non-optional)variableintheURLtemplateisnotavailable(forexample,tryingtoexecuteanAcceleratorthatincludes{linkRel}intheactionattributeagainstalinkwithnorelattribute)theAcceleratorcannotbeexecutedanditsentryintheshortcutmenuisdimmed. ∙Ifanyos: parameterelementhasanemptyvalueforanyreason,itwillnotappearintherequest. URLTemplateParameters URLparametersconveyinformationfromtheWebpagetotheservice.Inagetrequest,allparametersarepassedontheURLwhetheryouspecifythemasos: parameterelementsoraddvariablesdirectlytotheURLtemplate. Note Ifyouspecifyos: parameterelements,theURLparametersfollowingthequestionmark(? )intheURLtemplatewillnotbeused. MakesuretocorrectlyidentifyoptionalvariablesintheURLtemplate.Considerthefollowingtemplate: 复制 executemethod="get" action="/> Inthisexample,documentUrlisarequiredvariableanddocumentTitleisoptional.IfthevalueofdocumentTitleisempty,thenanemptystringisusedforthetitleparameterontheURL.However,iftherequiredvalueofdocumentUrlisempty,thentheAcceleratorwillbeunavailable(grayedout)ontheAcceleratorshortcutmenu. Form-basedParameters Inapostrequest,theos: parameterelementsspecifythename/valuepairsoftheforminput.Thisfollowingexamplepassesthesamevaluesastheprecedingone. 复制 executemethod="post"action=" parametername="url"value="{documentUrl}"/> parametername="title"value="{documentTitle? }"/> execute> Ifarequired(non-optional)parameterisundefined,theparameterisignored.Forexample,if{selection}werespecifiedbutnotavailable,theparameterwouldbedroppedfromtherequest. SelectionTypes Selectedtextcanbeinterpretedintwoways: asplain"text"(thedefault),oras"html"markup.Theselectiontypeissetontheos: parameterelement. SelectedtextisencodedasrequiredbytheselectedHTTPrequestmethod.OntheURL,thismeansthatnon-alphanumericcharactersarepercent-encodedandlinebreaksarepassedas"CRLF"pairs(%0D%0A).Iftheuserchoosestosendmultiplelinesoftextinaselection,theWebservicemustbeabletohandlethe"CRLF"gracefully. SecurityAlert WebservicesthatacceptHTMLasinputmustbecorrectlyconfiguredtohandlearbitraryHTMLinput.WebservicesthatallowarbitraryinputwithoutfilteringorencodingaresusceptibletoHTML/scriptinjectionattacks. IfyoucreateanAcceleratorthatusesa{selection}parameteroftypehtml,makesuretheWebserviceissetuptocorrectlyinterpretit.ConsiderthefollowingservicethatnaivelyacceptstextfromthequerystringoftheURLandplacesitdirectlyinthevalueattributeofatextinputbyusingActiveServerPages(ASP): 复制 Inthiscase,iftheserviceweretoacceptHTMLfromtheAccelerator,itispossiblethattheincomingtextcouldprematurelyclosetheinputtagandrewriteportionsoftheWebpage.Evenworse,maliciousscriptorSQLstatementsinjectedinthisfashionwouldbeallowedtoruninthecontextofthedomainthathoststheWebsite.Toreadmoreabouthowtovalidateinputtoprotectyourapplicationfrominjectionattacks,seeHowTo: ProtectFromInjectionAttacksinASP.NET.Seealsothediscussionofclient-sidescriptinjectionusinginnerHTML. SecurityImplicationsofDocumentVariables Becausedocumentvariablescouldbeusedtotrackuserswithouttheirknowledge,thesevariablescannotbeusedincertaincontexts. ∙DocumentvariablescannotbeusedbyapreviewAcceleratorexceptinthedocumentcontext. ∙ThetransmissionofdocumentvariablesisprohibitedbetweenHTTPandSecureHypertextTransferProtocol(HTTPS),andfromasecurityzoneoflesserrestrictiontoahigherone,suchasfromapageintheintranetzonetoaserverontheInternet. Ifarequireddocumentvariableisunavailableforanyreason,theAcceleratorentryintheshortcutmenuwillbedimmed. Preview AnAcceleratorcanprovideanoptionalHTMLpreviewthatisdisplayedwhentheuserhoversoveranAcceleratoronthemenu.Previewsareusefultoquicklyobtainamap,in-placedefinitionortranslation,contentratings,orlinkstorelatedcontent. Thepreviewwindowshouldbeusedforlightweightinteraction.ItcancontainlinksthatsendtheusertoafullWebpageformoreinformation.PreviewdoesnotpreventtheuserfromclickingtheAcceleratormenuitem. Previewfunctionalityisex
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- OpenService Accelerators Developer Guide