NPAPI: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Gsdefender2 (discussione | contributi)
+fine sezione
Gsdefender2 (discussione | contributi)
+paragrafo
Riga 36:
 
Ciò rese non più necessaria la dipendenza da Java, ma provocò alcuni problemi. In particolare, poichè l'implementazione viene effettuata utilizzando componenti XPCOM, una tecnologia simile a [[Component Object Model|Microsoft COM]], lo sviluppatore del plugin deve saper gestire il reference counting, le interfacce, l'IDL e così via per poter implementare lo scripting. Inoltre, la dipendenza da XPCOM comportava alcuni problemi nel collegamento dinamico delle librerie (ad esempio il problema della [[classe base fragile]]) che dovevano essere risolti per permettere al plugin di funzionare correttamente con browser differenti. XPCOM è stato in seguito modificato in modo tale da fornire una versione collegata staticamente per risolvere tali problemi. Quest'approccio richiede anche l'installazione di un file .xpt nella stessa locazione scelta per la DLL, altrimenti il plugin sembrerà funzionare, mentre la funzionalità di scripting non sara disponibile.
<!--
 
=== npruntime ===
End of 2004, all major browser companies (except Microsoft) agreed on [http://www.mozilla.org/projects/plugins/npruntime.html npruntime] as an extension to the original NPAPI to supply scripting, via an API that is similar in style to the old C-style NPAPI and is independent of other browser technologies like Java or XPCOM.
 
Alla fine del 2004, tutti i maggiori sviluppatori di browser (eccetto [[Microsoft]]) scelsero congiuntamente [http://www.mozilla.org/projects/plugins/npruntime.html npruntime] come estensione alla NPAPI originaria per fornire funzionalità di scripting, tramite un'API simile alla vecchia API stile C, ed indipendente da altre tecnologie quali Java o XPCOM.
It is supported by the latest generation of Mozilla (1.7.5+) / Firefox, Safari, and Opera. All new plugins should use this API.
 
npruntime è supportato dalla generazione più recente di browser Mozilla (1.7.5+) / Firefox, Safari ed Opera. Tutti i nuovi plugin dovrebbero usare questa API.
== NPAPI vs ActiveX controls ==
 
Microsoft developed OLE2 ([[Object linking and embedding|Object Linking and Embedding]]) as a way to create compound documents in applications such as Microsoft Word. For example a word processor document might contain an embedded spreadsheet that could be launched within the confines of the word processor window. OLE2 was based on [[Component Object Model|COM]] and defined interfaces for the various tasks that the container and the object needed to perform. An OLE2 control (sometimes known as an OCX) was a light OLE2 object that could be embedded into a container but did not save large amounts of data or require menus or toolbars to function.
=== Confronto tra NPAPI e i controlli ActiveX ==
 
Microsoft sviluppò OLE2 ([[Object linking and embedding|Object Linking and Embedding]]) per rendere possibile la creazione di documenti composti in applicazioni quali Microsoft word. Per esempio, un documento scritto in un word processor potrebbe contenere un foglio di calcolo incorporato che potrebbe essere lanciato all'interno della finestra del word processor.
<!--
Microsoft developed OLE2 ([[Object linking and embedding|Object Linking and Embedding]]) as a way to create compound documents in applications such as Microsoft Word. For example a word processor document might contain an embedded spreadsheet that could be launched within the confines of the word processor window. OLE2 was based on [[Component Object Model|COM]] and defined interfaces for the various tasks that the container and the object needed to perform. An OLE2 control (sometimes known as an OCX) was a light OLE2 object that could be embedded into a container but did not save large amounts of data or require menus or toolbars to function.
 
A control was implemented as a DLL and loaded into the address space of the host container such as [[Visual Basic]]. Earlier versions of Visual Basic used a similar technology called [[Visual Basic Extension]]s but OCX controls were seen as superior. Each OCX implemented a well defined subset of the OLE2 interfaces that the container could use to manipulate the control, such as repositioning it, or to provide information about the container. The OCX also implemented an ''automation interface'' which allowed it to expose methods and properties that could be manipulated, and used mechanism in the other direction to fire events to the container.