Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cjs_app.cpp
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "fxjs/cjs_app.h"
8
9#include <stdint.h>
10
11#include <algorithm>
12#include <utility>
13
14#include "core/fxcrt/fixed_size_data_vector.h"
15#include "core/fxcrt/stl_util.h"
16#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
17#include "fpdfsdk/cpdfsdk_interactiveform.h"
18#include "fxjs/cjs_document.h"
19#include "fxjs/cjs_timerobj.h"
20#include "fxjs/global_timer.h"
21#include "fxjs/ijs_event_context.h"
22#include "fxjs/js_resources.h"
23#include "third_party/base/containers/span.h"
24#include "v8/include/v8-container.h"
25
26namespace {
27
28constexpr wchar_t kStrViewerType[] = L"pdfium";
29constexpr wchar_t kStrViewerVariation[] = L"Full";
30constexpr wchar_t kStrPlatform[] = L"WIN";
31constexpr wchar_t kStrLanguage[] = L"ENU";
32constexpr int kNumViewerVersion = 8;
33constexpr int kNumViewerVersionXfa = 11;
34constexpr int kNumFormsVersion = 7;
35
36} // namespace
37
38const JSPropertySpec CJS_App::PropertySpecs[] = {
39 {"activeDocs", get_active_docs_static, set_active_docs_static},
40 {"calculate", get_calculate_static, set_calculate_static},
41 {"formsVersion", get_forms_version_static, set_forms_version_static},
42 {"fs", get_fs_static, set_fs_static},
43 {"fullscreen", get_fullscreen_static, set_fullscreen_static},
44 {"language", get_language_static, set_language_static},
45 {"media", get_media_static, set_media_static},
46 {"platform", get_platform_static, set_platform_static},
47 {"runtimeHighlight", get_runtime_highlight_static,
48 set_runtime_highlight_static},
49 {"viewerType", get_viewer_type_static, set_viewer_type_static},
50 {"viewerVariation", get_viewer_variation_static,
51 set_viewer_variation_static},
52 {"viewerVersion", get_viewer_version_static, set_viewer_version_static}};
53
54const JSMethodSpec CJS_App::MethodSpecs[] = {
55 {"alert", alert_static},
56 {"beep", beep_static},
57 {"browseForDoc", browseForDoc_static},
58 {"clearInterval", clearInterval_static},
59 {"clearTimeOut", clearTimeOut_static},
60 {"execDialog", execDialog_static},
61 {"execMenuItem", execMenuItem_static},
62 {"findComponent", findComponent_static},
63 {"goBack", goBack_static},
64 {"goForward", goForward_static},
65 {"launchURL", launchURL_static},
66 {"mailMsg", mailMsg_static},
67 {"newFDF", newFDF_static},
68 {"newDoc", newDoc_static},
69 {"openDoc", openDoc_static},
70 {"openFDF", openFDF_static},
71 {"popUpMenuEx", popUpMenuEx_static},
72 {"popUpMenu", popUpMenu_static},
73 {"response", response_static},
74 {"setInterval", setInterval_static},
75 {"setTimeOut", setTimeOut_static}};
76
77uint32_t CJS_App::ObjDefnID = 0;
78
79const char CJS_App::kName[] = "app";
80
81// static
82uint32_t CJS_App::GetObjDefnID() {
83 return ObjDefnID;
84}
85
86// static
87void CJS_App::DefineJSObjects(CFXJS_Engine* pEngine) {
88 ObjDefnID = pEngine->DefineObj(CJS_App::kName, FXJSOBJTYPE_STATIC,
89 JSConstructor<CJS_App>, JSDestructor);
90 DefineProps(pEngine, ObjDefnID, PropertySpecs);
91 DefineMethods(pEngine, ObjDefnID, MethodSpecs);
92}
93
94CJS_App::CJS_App(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime)
95 : CJS_Object(pObject, pRuntime) {}
96
97CJS_App::~CJS_App() = default;
98
99CJS_Result CJS_App::get_active_docs(CJS_Runtime* pRuntime) {
100 v8::Local<v8::Object> pObj = pRuntime->GetThisObj();
101 auto pJSDocument = JSGetObject<CJS_Document>(pRuntime->GetIsolate(), pObj);
102 if (!pJSDocument)
104 v8::Local<v8::Array> aDocs = pRuntime->NewArray();
105 pRuntime->PutArrayElement(aDocs, 0, pJSDocument->ToV8Object());
106 if (pRuntime->GetArrayLength(aDocs) > 0)
107 return CJS_Result::Success(aDocs);
108
109 return CJS_Result::Success(pRuntime->NewUndefined());
110}
111
112CJS_Result CJS_App::set_active_docs(CJS_Runtime* pRuntime,
113 v8::Local<v8::Value> vp) {
115}
116
117CJS_Result CJS_App::get_calculate(CJS_Runtime* pRuntime) {
118 return CJS_Result::Success(pRuntime->NewBoolean(m_bCalculate));
119}
120
121CJS_Result CJS_App::set_calculate(CJS_Runtime* pRuntime,
122 v8::Local<v8::Value> vp) {
123 m_bCalculate = pRuntime->ToBoolean(vp);
125 m_bCalculate);
127}
128
129CJS_Result CJS_App::get_forms_version(CJS_Runtime* pRuntime) {
130 return CJS_Result::Success(pRuntime->NewNumber(kNumFormsVersion));
131}
132
133CJS_Result CJS_App::set_forms_version(CJS_Runtime* pRuntime,
134 v8::Local<v8::Value> vp) {
136}
137
138CJS_Result CJS_App::get_viewer_type(CJS_Runtime* pRuntime) {
139 return CJS_Result::Success(pRuntime->NewString(kStrViewerType));
140}
141
142CJS_Result CJS_App::set_viewer_type(CJS_Runtime* pRuntime,
143 v8::Local<v8::Value> vp) {
145}
146
147CJS_Result CJS_App::get_viewer_variation(CJS_Runtime* pRuntime) {
148 return CJS_Result::Success(pRuntime->NewString(kStrViewerVariation));
149}
150
151CJS_Result CJS_App::set_viewer_variation(CJS_Runtime* pRuntime,
152 v8::Local<v8::Value> vp) {
154}
155
156CJS_Result CJS_App::get_viewer_version(CJS_Runtime* pRuntime) {
157 CPDF_Document::Extension* pContext =
159 int version = pContext && pContext->ContainsExtensionForm()
160 ? kNumViewerVersionXfa
161 : kNumViewerVersion;
162 return CJS_Result::Success(pRuntime->NewNumber(version));
163}
164
165CJS_Result CJS_App::set_viewer_version(CJS_Runtime* pRuntime,
166 v8::Local<v8::Value> vp) {
168}
169
170CJS_Result CJS_App::get_platform(CJS_Runtime* pRuntime) {
171 CPDFSDK_FormFillEnvironment* pFormFillEnv = pRuntime->GetFormFillEnv();
172 if (pFormFillEnv) {
173 WideString platform = pFormFillEnv->GetPlatform();
174 if (!platform.IsEmpty())
175 return CJS_Result::Success(pRuntime->NewString(platform.AsStringView()));
176 }
177 return CJS_Result::Success(pRuntime->NewString(kStrPlatform));
178}
179
180CJS_Result CJS_App::set_platform(CJS_Runtime* pRuntime,
181 v8::Local<v8::Value> vp) {
183}
184
185CJS_Result CJS_App::get_language(CJS_Runtime* pRuntime) {
186 CPDFSDK_FormFillEnvironment* pFormFillEnv = pRuntime->GetFormFillEnv();
187 if (pFormFillEnv) {
188 WideString language = pFormFillEnv->GetLanguage();
189 if (!language.IsEmpty())
190 return CJS_Result::Success(pRuntime->NewString(language.AsStringView()));
191 }
192 return CJS_Result::Success(pRuntime->NewString(kStrLanguage));
193}
194
195CJS_Result CJS_App::set_language(CJS_Runtime* pRuntime,
196 v8::Local<v8::Value> vp) {
198}
199
200// creates a new fdf object that contains no data
201// comment: need reader support
202// note:
203// CFDF_Document * CPDFSDK_FormFillEnvironment::NewFDF();
204CJS_Result CJS_App::newFDF(CJS_Runtime* pRuntime,
205 pdfium::span<v8::Local<v8::Value>> params) {
207}
208
209// opens a specified pdf document and returns its document object
210// comment:need reader support
211// note: as defined in js reference, the proto of this function's fourth
212// parmeters, how old an fdf document while do not show it.
213// CFDF_Document * CPDFSDK_FormFillEnvironment::OpenFDF(string strPath,bool
214// bUserConv);
215
216CJS_Result CJS_App::openFDF(CJS_Runtime* pRuntime,
217 pdfium::span<v8::Local<v8::Value>> params) {
219}
220
221CJS_Result CJS_App::alert(CJS_Runtime* pRuntime,
222 pdfium::span<v8::Local<v8::Value>> params) {
223 v8::LocalVector<v8::Value> newParams = ExpandKeywordParams(
224 pRuntime, params, 4, "cMsg", "nIcon", "nType", "cTitle");
225
226 if (!IsExpandedParamKnown(newParams[0]))
228
229 CPDFSDK_FormFillEnvironment* pFormFillEnv = pRuntime->GetFormFillEnv();
230 if (!pFormFillEnv)
231 return CJS_Result::Success(pRuntime->NewNumber(0));
232
233 WideString swMsg;
234 if (newParams[0]->IsArray()) {
235 v8::Local<v8::Array> carray = pRuntime->ToArray(newParams[0]);
236 swMsg = L"[";
237 for (size_t i = 0; i < pRuntime->GetArrayLength(carray); ++i) {
238 if (i)
239 swMsg += L", ";
240
241 swMsg += pRuntime->ToWideString(pRuntime->GetArrayElement(carray, i));
242 }
243 swMsg += L"]";
244 } else {
245 swMsg = pRuntime->ToWideString(newParams[0]);
246 }
247
249 if (IsExpandedParamKnown(newParams[1]))
250 iIcon = pRuntime->ToInt32(newParams[1]);
251
253 if (IsExpandedParamKnown(newParams[2]))
254 iType = pRuntime->ToInt32(newParams[2]);
255
256 WideString swTitle;
257 if (IsExpandedParamKnown(newParams[3]))
258 swTitle = pRuntime->ToWideString(newParams[3]);
259 else
261
262 pRuntime->BeginBlock();
263 pFormFillEnv->KillFocusAnnot({});
264 v8::Local<v8::Value> ret = pRuntime->NewNumber(
265 pFormFillEnv->JS_appAlert(swMsg, swTitle, iType, iIcon));
266 pRuntime->EndBlock();
267
268 return CJS_Result::Success(ret);
269}
270
271CJS_Result CJS_App::beep(CJS_Runtime* pRuntime,
272 pdfium::span<v8::Local<v8::Value>> params) {
273 if (params.size() != 1)
275
276 int type = JSPLATFORM_BEEP_DEFAULT;
277 if (IsExpandedParamKnown(params[0]))
278 type = pRuntime->ToInt32(params[0]);
279
280 pRuntime->GetFormFillEnv()->JS_appBeep(type);
282}
283
284CJS_Result CJS_App::findComponent(CJS_Runtime* pRuntime,
285 pdfium::span<v8::Local<v8::Value>> params) {
287}
288
289CJS_Result CJS_App::popUpMenuEx(CJS_Runtime* pRuntime,
290 pdfium::span<v8::Local<v8::Value>> params) {
292}
293
294CJS_Result CJS_App::get_fs(CJS_Runtime* pRuntime) {
296}
297
298CJS_Result CJS_App::set_fs(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
300}
301
302CJS_Result CJS_App::setInterval(CJS_Runtime* pRuntime,
303 pdfium::span<v8::Local<v8::Value>> params) {
304 if (params.size() == 0 || params.size() > 2)
306
307 WideString script = pRuntime->ToWideString(params[0]);
308 if (script.IsEmpty())
310
311 uint32_t dwInterval = params.size() > 1 ? pRuntime->ToInt32(params[1]) : 1000;
312 auto timerRef = std::make_unique<GlobalTimer>(
313 this, pRuntime, GlobalTimer::Type::kRepeating, script, dwInterval, 0);
314 GlobalTimer* pTimerRef = timerRef.get();
315 m_Timers.insert(std::move(timerRef));
316
317 v8::Local<v8::Object> pRetObj = pRuntime->NewFXJSBoundObject(
318 CJS_TimerObj::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
319 if (pRetObj.IsEmpty())
321
322 auto* pJS_TimerObj = static_cast<CJS_TimerObj*>(
323 CFXJS_Engine::GetObjectPrivate(pRuntime->GetIsolate(), pRetObj));
324
325 pJS_TimerObj->SetTimer(pTimerRef);
326 return CJS_Result::Success(pRetObj);
327}
328
329CJS_Result CJS_App::setTimeOut(CJS_Runtime* pRuntime,
330 pdfium::span<v8::Local<v8::Value>> params) {
331 if (params.size() == 0 || params.size() > 2)
333
334 WideString script = pRuntime->ToWideString(params[0]);
335 if (script.IsEmpty())
337
338 uint32_t dwTimeOut = params.size() > 1 ? pRuntime->ToInt32(params[1]) : 1000;
339 auto timerRef =
340 std::make_unique<GlobalTimer>(this, pRuntime, GlobalTimer::Type::kOneShot,
341 script, dwTimeOut, dwTimeOut);
342 GlobalTimer* pTimerRef = timerRef.get();
343 m_Timers.insert(std::move(timerRef));
344
345 v8::Local<v8::Object> pRetObj = pRuntime->NewFXJSBoundObject(
346 CJS_TimerObj::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
347 if (pRetObj.IsEmpty())
349
350 auto* pJS_TimerObj = static_cast<CJS_TimerObj*>(
351 CFXJS_Engine::GetObjectPrivate(pRuntime->GetIsolate(), pRetObj));
352
353 pJS_TimerObj->SetTimer(pTimerRef);
354 return CJS_Result::Success(pRetObj);
355}
356
357CJS_Result CJS_App::clearTimeOut(CJS_Runtime* pRuntime,
358 pdfium::span<v8::Local<v8::Value>> params) {
359 if (params.size() != 1)
361
362 CJS_App::ClearTimerCommon(pRuntime, params[0]);
364}
365
366CJS_Result CJS_App::clearInterval(CJS_Runtime* pRuntime,
367 pdfium::span<v8::Local<v8::Value>> params) {
368 if (params.size() != 1)
370
371 CJS_App::ClearTimerCommon(pRuntime, params[0]);
373}
374
375void CJS_App::ClearTimerCommon(CJS_Runtime* pRuntime,
376 v8::Local<v8::Value> param) {
377 if (!param->IsObject())
378 return;
379
380 v8::Local<v8::Object> pObj = pRuntime->ToObject(param);
381 auto pTimer = JSGetObject<CJS_TimerObj>(pRuntime->GetIsolate(), pObj);
382 if (!pTimer)
383 return;
384
385 GlobalTimer::Cancel(pTimer->GetTimerID());
386}
387
388CJS_Result CJS_App::execMenuItem(CJS_Runtime* pRuntime,
389 pdfium::span<v8::Local<v8::Value>> params) {
391}
392
393void CJS_App::TimerProc(GlobalTimer* pTimer) {
394 CJS_Runtime* pRuntime = pTimer->GetRuntime();
395 if (pRuntime && (!pTimer->IsOneShot() || pTimer->GetTimeOut() > 0))
396 RunJsScript(pRuntime, pTimer->GetJScript());
397}
398
399void CJS_App::CancelProc(GlobalTimer* pTimer) {
400 m_Timers.erase(fxcrt::MakeFakeUniquePtr(pTimer));
401}
402
403void CJS_App::RunJsScript(CJS_Runtime* pRuntime, const WideString& wsScript) {
404 if (pRuntime->IsBlocking())
405 return;
406
407 IJS_Runtime::ScopedEventContext pContext(pRuntime);
408 pContext->OnExternal_Exec();
409 pContext->RunScript(wsScript);
410}
411
412CJS_Result CJS_App::goBack(CJS_Runtime* pRuntime,
413 pdfium::span<v8::Local<v8::Value>> params) {
414 // Not supported, but do not return error.
416}
417
418CJS_Result CJS_App::goForward(CJS_Runtime* pRuntime,
419 pdfium::span<v8::Local<v8::Value>> params) {
420 // Not supported, but do not return error.
422}
423
424CJS_Result CJS_App::mailMsg(CJS_Runtime* pRuntime,
425 pdfium::span<v8::Local<v8::Value>> params) {
426 v8::LocalVector<v8::Value> newParams = ExpandKeywordParams(
427 pRuntime, params, 6, "bUI", "cTo", "cCc", "cBcc", "cSubject", "cMsg");
428
429 if (!IsExpandedParamKnown(newParams[0]))
431
432 bool bUI = pRuntime->ToBoolean(newParams[0]);
433 WideString cTo;
434 if (IsExpandedParamKnown(newParams[1])) {
435 cTo = pRuntime->ToWideString(newParams[1]);
436 } else {
437 // cTo parameter required when UI not invoked.
438 if (!bUI)
440 }
441
442 WideString cCc;
443 if (IsExpandedParamKnown(newParams[2]))
444 cCc = pRuntime->ToWideString(newParams[2]);
445
446 WideString cBcc;
447 if (IsExpandedParamKnown(newParams[3]))
448 cBcc = pRuntime->ToWideString(newParams[3]);
449
450 WideString cSubject;
451 if (IsExpandedParamKnown(newParams[4]))
452 cSubject = pRuntime->ToWideString(newParams[4]);
453
454 WideString cMsg;
455 if (IsExpandedParamKnown(newParams[5]))
456 cMsg = pRuntime->ToWideString(newParams[5]);
457
458 pRuntime->BeginBlock();
459 pRuntime->GetFormFillEnv()->JS_docmailForm(pdfium::span<const uint8_t>(), bUI,
460 cTo, cSubject, cCc, cBcc, cMsg);
461 pRuntime->EndBlock();
463}
464
465CJS_Result CJS_App::launchURL(CJS_Runtime* pRuntime,
466 pdfium::span<v8::Local<v8::Value>> params) {
467 // Unsafe, not supported, but do not return error.
469}
470
471CJS_Result CJS_App::get_runtime_highlight(CJS_Runtime* pRuntime) {
472 return CJS_Result::Success(pRuntime->NewBoolean(m_bRuntimeHighLight));
473}
474
475CJS_Result CJS_App::set_runtime_highlight(CJS_Runtime* pRuntime,
476 v8::Local<v8::Value> vp) {
477 m_bRuntimeHighLight = pRuntime->ToBoolean(vp);
479}
480
481CJS_Result CJS_App::get_fullscreen(CJS_Runtime* pRuntime) {
483}
484
485CJS_Result CJS_App::set_fullscreen(CJS_Runtime* pRuntime,
486 v8::Local<v8::Value> vp) {
488}
489
490CJS_Result CJS_App::popUpMenu(CJS_Runtime* pRuntime,
491 pdfium::span<v8::Local<v8::Value>> params) {
493}
494
495CJS_Result CJS_App::browseForDoc(CJS_Runtime* pRuntime,
496 pdfium::span<v8::Local<v8::Value>> params) {
497 // Unsafe, not supported, but do not return an error.
499}
500
501WideString CJS_App::SysPathToPDFPath(const WideString& sOldPath) {
502 WideString sRet = L"/";
503 for (const wchar_t& c : sOldPath) {
504 if (c != L':')
505 sRet += (c == L'\\') ? L'/' : c;
506 }
507 return sRet;
508}
509
510CJS_Result CJS_App::newDoc(CJS_Runtime* pRuntime,
511 pdfium::span<v8::Local<v8::Value>> params) {
513}
514
515CJS_Result CJS_App::openDoc(CJS_Runtime* pRuntime,
516 pdfium::span<v8::Local<v8::Value>> params) {
518}
519
520CJS_Result CJS_App::response(CJS_Runtime* pRuntime,
521 pdfium::span<v8::Local<v8::Value>> params) {
522 v8::LocalVector<v8::Value> newParams =
523 ExpandKeywordParams(pRuntime, params, 5, "cQuestion", "cTitle",
524 "cDefault", "bPassword", "cLabel");
525
526 if (!IsExpandedParamKnown(newParams[0]))
528
529 WideString swQuestion = pRuntime->ToWideString(newParams[0]);
530 WideString swTitle = L"PDF";
531 if (IsExpandedParamKnown(newParams[1]))
532 swTitle = pRuntime->ToWideString(newParams[1]);
533
534 WideString swDefault;
535 if (IsExpandedParamKnown(newParams[2]))
536 swDefault = pRuntime->ToWideString(newParams[2]);
537
538 bool bPassword = false;
539 if (IsExpandedParamKnown(newParams[3]))
540 bPassword = pRuntime->ToBoolean(newParams[3]);
541
542 WideString swLabel;
543 if (IsExpandedParamKnown(newParams[4]))
544 swLabel = pRuntime->ToWideString(newParams[4]);
545
546 constexpr int kMaxWideChars = 1024;
547 constexpr int kMaxBytes = kMaxWideChars * sizeof(uint16_t);
548 auto buffer = FixedSizeDataVector<uint8_t>::Zeroed(kMaxBytes);
549 int byte_length = pRuntime->GetFormFillEnv()->JS_appResponse(
550 swQuestion, swTitle, swDefault, swLabel, bPassword, buffer.span());
551
552 if (byte_length < 0 || byte_length > kMaxBytes)
554
555 auto wstr = WideString::FromUTF16LE(buffer.first(byte_length));
556 return CJS_Result::Success(pRuntime->NewString(wstr.AsStringView()));
557}
558
559CJS_Result CJS_App::get_media(CJS_Runtime* pRuntime) {
561}
562
563CJS_Result CJS_App::set_media(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
565}
566
567CJS_Result CJS_App::execDialog(CJS_Runtime* pRuntime,
568 pdfium::span<v8::Local<v8::Value>> params) {
570}
@ FXJSOBJTYPE_STATIC
static void DefineJSObjects(CFXJS_Engine *pEngine)
Definition cjs_app.cpp:87
static WideString SysPathToPDFPath(const WideString &sOldPath)
Definition cjs_app.cpp:501
void CancelProc(GlobalTimer *pTimer)
Definition cjs_app.cpp:399
static uint32_t GetObjDefnID()
Definition cjs_app.cpp:82
~CJS_App() override
void TimerProc(GlobalTimer *pTimer)
Definition cjs_app.cpp:393
CJS_App(v8::Local< v8::Object > pObject, CJS_Runtime *pRuntime)
Definition cjs_app.cpp:94
static void DefineProps(CFXJS_Engine *pEngine, uint32_t nObjDefnID, pdfium::span< const JSPropertySpec > consts)
static void DefineMethods(CFXJS_Engine *pEngine, uint32_t nObjDefnID, pdfium::span< const JSMethodSpec > consts)
static CJS_Result Success()
Definition cjs_result.h:27
static CJS_Result Failure(JSMessage id)
Definition cjs_result.h:34
void BeginBlock()
Definition cjs_runtime.h:47
void EndBlock()
Definition cjs_runtime.h:48
bool IsBlocking() const
Definition cjs_runtime.h:49
CPDFSDK_FormFillEnvironment * GetFormFillEnv() const override
CPDFSDK_InteractiveForm * GetInteractiveForm()
CPDF_Document::Extension * GetDocExtension() const
bool KillFocusAnnot(Mask< FWL_EVENTFLAG > nFlags)
virtual bool ContainsExtensionForm() const =0
uint32_t GetTimeOut() const
CJS_Runtime * GetRuntime() const
WideString GetJScript() const
bool IsOneShot() const
static void Cancel(int32_t nTimerID)
virtual void OnExternal_Exec()=0
IJS_EventContext * operator->() const
Definition ijs_runtime.h:42
WideString & operator=(WideString &&that) noexcept
WideString & operator+=(const wchar_t *str)
WideString & operator+=(wchar_t ch)
bool IsEmpty() const
Definition widestring.h:118
static WideString FromUTF16LE(pdfium::span< const uint8_t > data)
WideString & operator=(const wchar_t *str)
#define JSPLATFORM_BEEP_DEFAULT
#define JSPLATFORM_ALERT_BUTTON_DEFAULT
#define JSPLATFORM_ALERT_ICON_DEFAULT
JSMessage
@ kParamTooLongError
@ kObjectTypeError
@ kNotSupportedError
@ kInvalidInputError
WideString JSGetStringFromID(JSMessage msg)