Укажите отработанное время

Отработанное время:
Продуктивное время:
Bug 2034 - Нужна реализация HTMLWindow2_execScript   Make a simular bug
Summary: Нужна реализация HTMLWindow2_execScript
Status: DEFERRED
Alias: None
Product: Wine School
Classification: Продукты (Products)
Component: Общее (show other bugs)
Version: 0.9
Hardware: PC All
: P4 minor
Target Milestone: ---
Assignee: BUGS@Etersoft
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 2585 1527
  Show dependency treegraph
 
In work:
Reported: 2008-07-01 09:31 MSD by Синицын Иван
Modified: 2015-02-28 16:54 MSK (History)
2 users (show)

See Also:
Заявки RT:
Связано с:
Дата напоминания:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Синицын Иван 2008-07-01 09:31:29 MSD
Эта функция нужна для функционирования кнопок "Вперед" и "Назад" на клиенте 1С Образования.
Comment 1 Синицын Иван 2008-07-14 16:19:10 MSD
В сети встречен такой вот код, про реализацию Exec_script от mozilla

    virtual /* [id] */ HRESULT STDMETHODCALLTYPE execScript( 
        /* [in] */ BSTR code,
        /* [in][defaultvalue] */ BSTR language,
        /* [out][retval] */ VARIANT __RPC_FAR *pvarRet)
    {
        nsresult rv;

        nsCOMPtr<nsIDOMWindow> domWindow;
        NPN_GetValue(mData->pPluginInstance, NPNVDOMWindow, 
                     NS_STATIC_CAST(nsIDOMWindow **, getter_AddRefs(domWindow)));
        if (!domWindow)
        {
            return E_UNEXPECTED;
        }

        // Now get the DOM Document.  Accessing the document will create one
        // if necessary.  So, basically, this call ensures that a document gets
        // created -- if necessary.
        nsCOMPtr<nsIDOMDocument> domDocument;
        rv = domWindow->GetDocument(getter_AddRefs(domDocument));
        NS_ASSERTION(domDocument, "No DOMDocument!");
        if (NS_FAILED(rv)) {
            return E_UNEXPECTED;
        }

        nsCOMPtr<nsIScriptGlobalObject> globalObject(do_QueryInterface(domWindow));
        if (!globalObject)
            return E_UNEXPECTED;

        nsCOMPtr<nsIScriptContext> scriptContext = globalObject->GetContext();
        if (!scriptContext)
            return E_UNEXPECTED;

        nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDocument));
        if (!doc)
            return E_UNEXPECTED;

        nsIPrincipal *principal = doc->GetPrincipal();
        if (!principal)
            return E_UNEXPECTED;

        // Execute the script.
        //
        // Note: The script context takes care of the JS stack and of ensuring
        //       nothing is executed when JS is disabled.
        //
        nsAutoString scriptString(code);
        NS_NAMED_LITERAL_CSTRING(url, "javascript:axplugin");
        rv = scriptContext->EvaluateString(scriptString,
                                           nsnull,      // obj
                                           principal,
                                           url.get(),   // url
                                           1,           // line no
                                           nsnull,
                                           nsnull,
                                           nsnull);

        if (NS_FAILED(rv))
            return NS_ERROR_FAILURE;

        return S_OK;
    }

Распространяется под лицензиями MPL 1.1/GPL 2.0/LGPL 2.1
Если лицензии позволяют, можно попробывать адаптировать его для wine.
Comment 2 Vitaly Lipatov 2012-01-18 03:08:45 MSK
Откладываем, bugs@ в ближайшее время делать ничего не будет.