Subversion Repositories Kolibri OS

Rev

Rev 6730 | Rev 6738 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. //HTML Viewer in C--
  2. //Copyright 2007-2013 by Veliant & Leency
  3. //Asper, lev, Lrz, Barsuk, Nable...
  4. //home icon - rachel fu, GPL licence
  5.  
  6. #ifndef AUTOBUILD
  7.         #include "lang.h--"
  8. #endif
  9.  
  10. //libraries
  11. #define MEMSIZE 4096 * 256
  12. #include "..\lib\gui.h"
  13. #include "..\lib\draw_buf.h"
  14. #include "..\lib\list_box.h"
  15. #include "..\lib\cursor.h"
  16. #include "..\lib\collection.h"
  17. #include "..\lib\menu.h"
  18.  
  19. //*.obj libraries
  20. #include "..\lib\obj\box_lib.h"
  21. #include "..\lib\obj\libio_lib.h"
  22. #include "..\lib\obj\libimg_lib.h"
  23. #include "..\lib\obj\http.h"
  24. #include "..\lib\obj\iconv.h"
  25. //useful patterns
  26. #include "..\lib\patterns\libimg_load_skin.h"
  27. #include "..\lib\patterns\history.h"
  28. #include "..\lib\patterns\http_downloader.h"
  29.  
  30. char homepage[] = FROM "html\\homepage.htm""\0";
  31.  
  32. #ifdef LANG_RUS
  33. char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.53";
  34. ?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
  35. ?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
  36. char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
  37. char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0";
  38. char accept_language[]= "Accept-Language: ru\n";
  39. char rmb_menu[] =
  40. "®á¬®âà¥âì ¨á室­¨ª
  41. ¥¤ ªâ¨à®¢ âì ¨á室­¨ª
  42. ˆáâ®à¨ï
  43. Žç¨áâ¨âì ªíè ª à⨭®ª
  44. Œ¥­¥¤¦¥à § £à㧮ª";
  45. #else
  46. char version[]="Text-based Browser 1.53";
  47. ?define IMAGES_CACHE_CLEARED "Images cache cleared"
  48. ?define T_LAST_SLIDE "This slide is the last"
  49. char loading[] = "Loading...<br>";
  50. char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
  51. char accept_language[]= "Accept-Language: en\n";
  52. char rmb_menu[] =
  53. "View source
  54. Edit source
  55. History
  56. Free image cache
  57. Download Manager";
  58. #endif
  59.  
  60. #define URL_SERVICE_HISTORY "WebView://history"
  61. #define URL_SERVICE_HOME "WebView://home"
  62. #define URL_SERVICE_SOURCE "WebView://source:"
  63.  
  64. proc_info Form;
  65.  
  66. //char search_path[]="http://nigma.ru/index.php?s=";
  67. int redirected = 0;
  68.  
  69. char stak[4096];
  70.  
  71. int action_buf;
  72.  
  73. dword http_transfer = 0;
  74. dword http_buffer;
  75.  
  76. dword TOOLBAR_H = 40;
  77. dword STATUSBAR_H = 15;
  78. dword col_bg;
  79. dword panel_color;
  80. dword border_color;
  81.  
  82. progress_bar wv_progress_bar;
  83. byte souce_mode = false;
  84.  
  85. enum {
  86.         BACK_BUTTON=1000,
  87.         FORWARD_BUTTON,
  88.         REFRESH_BUTTON,
  89.         GOTOURL_BUTTON,
  90.         SANDWICH_BUTTON
  91. };
  92.  
  93. enum {
  94.         VIEW_SOURCE=1100,
  95.         EDIT_SOURCE,
  96.         VIEW_HISTORY,
  97.         FREE_IMG_CACHE,
  98.         DOWNLOAD_MANAGER
  99. };
  100.  
  101. #include "..\TWB\TWB.c"
  102. #include "history.h"
  103. #include "show_src.h"
  104. #include "download_manager.h"
  105.  
  106. char editURL[sizeof(URL)];
  107. int     mouse_twb;
  108. edit_box address_box = {250,60,30,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,sizeof(URL),#editURL,#mouse_twb,2,19,19};
  109.  
  110.  
  111. void main()
  112. {
  113.         CursorPointer.Load(#CursorFile);
  114.         load_dll(boxlib, #box_lib_init,0);
  115.         load_dll(libio, #libio_init,1);
  116.         load_dll(libimg, #libimg_init,1);
  117.         load_dll(libHTTP, #http_lib_init,1);
  118.         load_dll(iconv_lib, #iconv_open,0);
  119.         Libimg_LoadImage(#skin, abspath("wv_skin.png"));
  120.         SetSkinColors();
  121.         CreateDir("/tmp0/1/downloads");
  122.         if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME);
  123.         WB1.DrawBuf.zoom = 1;
  124.         WB1.list.SetFont(8, 14, 10011000b);
  125.         WB1.list.no_selection = true;
  126.         SetEventMask(0xa7);
  127.         BEGIN_LOOP_APPLICATION:
  128.                 WaitEventTimeout(2);
  129.                 switch(EAX & 0xFF)
  130.                 {
  131.                         CASE evMouse:
  132.                                 if (!CheckActiveProcess(Form.ID)) break;
  133.                                 edit_box_mouse stdcall (#address_box);
  134.                                 mouse.get();
  135.                                 if (WB1.list.MouseOver(mouse.x, mouse.y))
  136.                                 {
  137.                                         PageLinks.Hover(mouse.x, WB1.list.first*WB1.list.item_h + mouse.y, link_color_inactive, link_color_active, bg_color);
  138.                                         if (bufsize) && (mouse.pkm) && (mouse.up) {
  139.                                                 menu.show(Form.left+mouse.x-6,Form.top+mouse.y+skin_height+3, 180, #rmb_menu, VIEW_SOURCE);
  140.                                                 break;
  141.                                         }
  142.                                         if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
  143.                                 }
  144.                                 scrollbar_v_mouse (#scroll_wv);
  145.                                 if (WB1.list.first != scroll_wv.position)
  146.                                 {
  147.                                         WB1.list.first = scroll_wv.position;
  148.                                         WB1.DrawPage();
  149.                                         break;
  150.                                 }
  151.                                 break;
  152.  
  153.                         case evButton:
  154.                                 ProcessEvent(GetButtonID());
  155.                                 break;
  156.  
  157.                         case evKey:
  158.                                 GetKeys();
  159.                                 if (address_box.flags & 0b10)  
  160.                                 {
  161.                                         if (key_ascii == ASCII_KEY_ENTER) ProcessEvent(key_scancode); else {
  162.                                                 EAX = key_editbox;
  163.                                                 edit_box_key stdcall(#address_box);
  164.                                         }
  165.                                 }
  166.                                 else
  167.                                 {
  168.                                         if (WB1.list.ProcessKey(key_scancode)) WB1.DrawPage();
  169.                                         else ProcessEvent(key_scancode);
  170.                                 }
  171.                                 break;
  172.  
  173.                         case evReDraw:
  174.                                 if (menu.list.cur_y) {
  175.                                         ProcessEvent(menu.list.cur_y);
  176.                                         menu.list.cur_y = 0;
  177.                                 }
  178.                                 DefineAndDrawWindow(GetScreenWidth()-800/2,GetScreenHeight()-600/2,800,600,0x73,col_bg,0,0);
  179.                                 GetProcessInfo(#Form, SelfInfo);
  180.                                 if (Form.status_window>2) { DrawTitle(#header); break; }
  181.                                 if (Form.height<120) { MoveSize(OLD,OLD,OLD,120); break; }
  182.                                 if (Form.width<280) { MoveSize(OLD,OLD,280,OLD); break; }
  183.                                 Draw_Window();
  184.                                 break;
  185.                                
  186.                         case evNetwork:
  187.                                 if (http_transfer > 0) {
  188.                                         http_receive stdcall (http_transfer);
  189.                                         $push EAX
  190.                                         ESI = http_transfer;
  191.                                         wv_progress_bar.max = ESI.http_msg.content_length;
  192.                                         if (wv_progress_bar.value != ESI.http_msg.content_received)
  193.                                         {
  194.                                                 wv_progress_bar.value = ESI.http_msg.content_received; 
  195.                                                 DrawProgress();
  196.                                         }
  197.                                         $pop EAX
  198.                                         if (EAX == 0) {
  199.                                                 ESI = http_transfer;
  200.                                                 // Handle redirects
  201.                                                 if (ESI.http_msg.status >= 300) && (ESI.http_msg.status < 400)
  202.                                                 {
  203.                                                         redirected++;
  204.                                                         if (redirected<=5)
  205.                                                         {
  206.                                                                 http_find_header_field stdcall (http_transfer, "location\0");
  207.                                                                 if (EAX!=0) {
  208.                                                                         ESI = EAX;
  209.                                                                         EDI = #URL;
  210.                                                                         do {
  211.                                                                                 $lodsb;
  212.                                                                                 $stosb;
  213.                                                                         } while (AL != 0) && (AL != 13) && (AL != 10);
  214.                                                                         DSBYTE[EDI-1]='\0';
  215.                                                                         if (!strcmp(#URL,"https://"))
  216.                                                                         {
  217.                                                                                 notify("HTTPS protocol is not supported yet");
  218.                                                                                 StopLoading();         
  219.                                                                         }
  220.                                                                 }
  221.                                                         }
  222.                                                         else
  223.                                                         {
  224.                                                                 notify("Too many redirects");
  225.                                                                 StopLoading();
  226.                                                                 break;
  227.                                                         }
  228.                                                 }
  229.                                                 else
  230.                                                 {
  231.                                                         redirected = 0;
  232.                                                 }
  233.                                                 // Loading the page is complete, free resources
  234.                                                 if (redirected>0)
  235.                                                 {
  236.                                                         http_free stdcall (http_transfer);
  237.                                                         http_transfer=0;
  238.                                                         GetAbsoluteURL(#URL);
  239.                                                         history.back();
  240.                                                         strcpy(#editURL, #URL);
  241.                                                         DrawEditBoxWebView();
  242.                                                         OpenPage();
  243.                                                 }
  244.                                                 else
  245.                                                 {
  246.                                                         history.add(#URL);
  247.                                                         ESI = http_transfer;
  248.                                                         bufpointer = ESI.http_msg.content_ptr;
  249.                                                         bufsize = ESI.http_msg.content_received;
  250.                                                         http_free stdcall (http_transfer);
  251.                                                         http_transfer=0;
  252.                                                         SetPageDefaults();
  253.                                                         ShowPage();
  254.                                                 }
  255.                                         }
  256.                                 }
  257.                 }
  258.         goto BEGIN_LOOP_APPLICATION;
  259. }
  260.  
  261. void SetElementSizes()
  262. {
  263.         address_box.top = TOOLBAR_H/2-10;
  264.         address_box.width = Form.cwidth - address_box.left - 50;
  265.         WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x / WB1.DrawBuf.zoom,
  266.                 Form.cheight - TOOLBAR_H - STATUSBAR_H, WB1.list.font_h + WB1.DrawBuf.zoom + WB1.DrawBuf.zoom * WB1.DrawBuf.zoom);
  267.         WB1.list.wheel_size = 7;
  268.         WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w;
  269.         WB1.list.visible = WB1.list.h - 5 / WB1.list.item_h;
  270.         if (WB1.list.w!=WB1.DrawBuf.bufw) {
  271.                 WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, 2048 * WB1.list.item_h);
  272.                 ProcessEvent(REFRESH_BUTTON);
  273.         }
  274. }
  275.  
  276.  
  277.  
  278. void Draw_Window()
  279. {
  280.         DrawBar(0,0, Form.cwidth,TOOLBAR_H-2, panel_color);
  281.         DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, 0xD7D0D3);
  282.         DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, border_color);
  283.         SetElementSizes();
  284.         DrawRectangle(address_box.left-3, address_box.top-3, address_box.width+5, 25,border_color);
  285.         DefineButton(address_box.left-52, address_box.top-2, 24, skin.h-2, BACK_BUTTON+BT_HIDE, 0);
  286.         DefineButton(address_box.left-27, address_box.top-2, 24, skin.h-2, FORWARD_BUTTON+BT_HIDE, 0);
  287.         img_draw stdcall(skin.image, address_box.left-53, address_box.top-3, 51, skin.h, 3, 0);
  288.         DefineButton(address_box.left+address_box.width+1, address_box.top-3, 16, skin.h-1, REFRESH_BUTTON+BT_HIDE+BT_NOFRAME, 0);
  289.         DefineButton(Form.cwidth-27, address_box.top-3, 23, skin.h-1, SANDWICH_BUTTON+BT_HIDE, 0);
  290.         img_draw stdcall(skin.image, Form.cwidth-24, address_box.top-3, 17, skin.h, 87, 0);
  291.         DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,STATUSBAR_H, col_bg);
  292.         DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, border_color);
  293.         if (!header) OpenPage(); else { WB1.DrawPage(); DrawEditBoxWebView(); }
  294.         DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col);
  295.         DrawProgress();
  296. }
  297.  
  298.  
  299. void ProcessEvent(dword id__)
  300. {
  301.         switch (id__)
  302.         {
  303.                 case 1:
  304.                         ExitProcess();
  305.                         return;
  306.                 case SCAN_CODE_BS:
  307.                 case BACK_BUTTON:
  308.                         if (history.back()) {
  309.                                 strcpy(#URL, history.current());
  310.                                 OpenPage();
  311.                         }
  312.                         return;
  313.                 case FORWARD_BUTTON:
  314.                         if (history.forward()) {
  315.                                 strcpy(#URL, history.current());
  316.                                 OpenPage();
  317.                         }
  318.                         return;
  319.                 case GOTOURL_BUTTON:
  320.                 case SCAN_CODE_ENTER:
  321.                         if (!strncmp(#editURL,"http:",5)) || (editURL[0]=='/')
  322.                         || (!strncmp(#editURL,"https:",6)) || (!strncmp(#editURL,"WebView:",8))
  323.                         {
  324.                                 strcpy(#URL, #editURL);
  325.                         }
  326.                         else
  327.                         {
  328.                                 strlcpy(#URL,"http://",7);
  329.                                 strcat(#URL, #editURL);
  330.                         }
  331.                         OpenPage();
  332.                         return;
  333.                 case 063: //F5
  334.                         IF(address_box.flags & 0b10) return;
  335.                 case REFRESH_BUTTON:
  336.                         if (http_transfer > 0)
  337.                         {
  338.                                 StopLoading();
  339.                                 Draw_Window();
  340.                         }
  341.                         else OpenPage();
  342.                         return;
  343.                 case SANDWICH_BUTTON:
  344.                         mouse.y = TOOLBAR_H-6;
  345.                         mouse.x = Form.cwidth - 167;
  346.                         menu.show(Form.left+mouse.x-6,Form.top+mouse.y+skin_height+3, 180, #rmb_menu, VIEW_SOURCE);
  347.                         return;
  348.                 case VIEW_SOURCE:
  349.                         WB1.list.first = 0;
  350.                         ShowSource();
  351.                         WB1.LoadInternalPage(bufpointer, bufsize);
  352.                         break;
  353.                 case EDIT_SOURCE:
  354.                         if (!strncmp(#URL,"http:",5))
  355.                         {
  356.                                 WriteFile(bufsize, bufpointer, "/tmp0/1/WebView_tmp.htm");
  357.                                 if (!EAX) RunProgram("/rd/1/tinypad", "/tmp0/1/WebView_tmp.htm");
  358.                         }
  359.                         else RunProgram("/rd/1/tinypad", #URL);
  360.                         return;
  361.                 case FREE_IMG_CACHE:
  362.                         ImgCache.Free();
  363.                         notify(IMAGES_CACHE_CLEARED);
  364.                         WB1.DrawPage();
  365.                         return;
  366.                 case VIEW_HISTORY:
  367.                         strcpy(#URL, URL_SERVICE_HISTORY);
  368.                         OpenPage();
  369.                         return;
  370.                 case DOWNLOAD_MANAGER:
  371.                         if (!downloader_opened) {
  372.                                 downloader_edit = NULL;
  373.                                 CreateThread(#Downloader,#downloader_stak+4092);
  374.                         }
  375.                         return;
  376.         }
  377. }
  378.  
  379.  
  380. void StopLoading()
  381. {
  382.         if (http_transfer)
  383.         {
  384.                 EAX = http_transfer;
  385.                 EAX = EAX.http_msg.content_ptr;         // get pointer to data
  386.                 $push   EAX                                                     // save it on the stack
  387.                 http_free stdcall (http_transfer);      // abort connection
  388.                 $pop    EAX                                                    
  389.                 free(EAX);                                              // free data
  390.                 http_transfer=0;
  391.                 bufsize = 0;
  392.                 bufpointer = free(bufpointer);
  393.         }
  394.         wv_progress_bar.value = 0;
  395.         DrawEditBoxWebView();
  396. }
  397.  
  398. void SetPageDefaults()
  399. {
  400.         strcpy(#header, #version);
  401.         WB1.list.count = WB1.list.first = 0;
  402.         stroka = 0;
  403.         cur_encoding = CH_NULL;
  404.         if (o_bufpointer) o_bufpointer = free(o_bufpointer);
  405.         anchor_line_num=WB1.list.first;
  406.         anchor[0]='|';
  407. }
  408.  
  409. void OpenPage()
  410. {
  411.         StopLoading();
  412.         souce_mode = false;
  413.         strcpy(#editURL, #URL);
  414.         history.add(#URL);
  415.         if (!strncmp(#URL,"WebView:",8))
  416.         {
  417.                 SetPageDefaults();
  418.                 if (!strcmp(#URL, URL_SERVICE_HOME)) WB1.LoadInternalPage(#homepage, sizeof(homepage));
  419.                 else if (!strcmp(#URL, URL_SERVICE_HISTORY)) ShowHistory();
  420.                 DrawEditBoxWebView();
  421.                 return;
  422.         }
  423.         if (!strncmp(#URL,"http:",5))
  424.         {
  425.                 img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, 131, 0);
  426.                 http_get stdcall (#URL, 0, 0, #accept_language);
  427.                 http_transfer = EAX;
  428.                 if (!http_transfer)
  429.                 {
  430.                         StopLoading();
  431.                         bufsize = 0;
  432.                         bufpointer = free(bufpointer);
  433.                         ShowPage();
  434.                         return;
  435.                 }
  436.         }
  437.         else
  438.         {
  439.                 file_size stdcall (#URL);
  440.                 bufsize = EBX;
  441.                 if (bufsize)
  442.                 {
  443.                         free(bufpointer);
  444.                         bufpointer = malloc(bufsize);
  445.                         SetPageDefaults();
  446.                         ReadFile(0, bufsize, bufpointer, #URL);
  447.                 }
  448.                 ShowPage();
  449.         }
  450. }
  451.  
  452. DrawEditBoxWebView()
  453. {
  454.         DrawBar(address_box.left-2, address_box.top-2, address_box.width+3, 2, address_box.color);
  455.         DrawBar(address_box.left-2, address_box.top, 2, 22, address_box.color);
  456.         address_box.size = address_box.pos = address_box.shift = address_box.shift_old = strlen(#editURL);
  457.         address_box.offset = 0;
  458.         edit_box_draw stdcall(#address_box);
  459.         if (http_transfer > 0) EAX = 131; else EAX = 54;
  460.         img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, EAX, 0);
  461. }
  462.  
  463.  
  464. void ShowPage()
  465. {
  466.         DrawEditBoxWebView();
  467.         if (!bufsize)
  468.         {
  469.                 if (http_transfer) WB1.LoadInternalPage(#loading, sizeof(loading));
  470.                 else WB1.LoadInternalPage(#page_not_found, sizeof(page_not_found));
  471.         }
  472.         else
  473.         {
  474.                 WB1.Prepare();
  475.         }
  476.         if (!strcmp(#version, #header)) DrawTitle(#header);
  477. }
  478.  
  479. byte UrlExtIs(dword ext)
  480. {
  481.         if (!strcmpi(#URL + strlen(#URL) - strlen(ext), ext)) return true;
  482.         return false;
  483. }
  484.  
  485. int SetSkinColors()
  486. {
  487.         dword image_data;
  488.         image_data = DSDWORD[skin.image+24];
  489.         col_bg = DSDWORD[image_data];
  490.         panel_color  = DSDWORD[skin.w*4*4 + image_data];
  491.         border_color = DSDWORD[skin.w*4*7 + image_data];
  492.         wv_progress_bar.progress_color = DSDWORD[skin.w*4*10 + image_data];
  493.         $and col_bg, 0x00ffffff
  494.         $and panel_color, 0x00ffffff
  495.         $and border_color, 0x00ffffff
  496.         $and wv_progress_bar.progress_color, 0x00ffffff
  497. }
  498.  
  499. void DrawProgress()
  500. {
  501.         unsigned long btn;
  502.         if (http_transfer == 0) return;
  503.         if (wv_progress_bar.max) btn = address_box.width*wv_progress_bar.value/wv_progress_bar.max; else btn = 30;
  504.         DrawBar(address_box.left-2, address_box.top+20, btn, 2, wv_progress_bar.progress_color);
  505. }
  506.  
  507. void ClickLink()
  508. {
  509.         if (http_transfer > 0)
  510.         {
  511.                 StopLoading();
  512.                 history.back();
  513.         }
  514.  
  515.         strcpy(#URL, PageLinks.GetURL(PageLinks.active));      
  516.         //#1
  517.         if (URL[0] == '#')
  518.         {
  519.                 if (URL[1] == NULL) {
  520.                         WB1.list.first = 0;
  521.                         strcpy(#URL, history.current());
  522.                 }
  523.                 else {
  524.                         strlcpy(#anchor, #URL+strrchr(#URL, '#'), sizeof(anchor));
  525.                         strcpy(#URL, history.current());
  526.                 }
  527.                 ShowPage();                    
  528.                 return;
  529.         }
  530.         //liner.ru#1
  531.         if (strrchr(#URL, '#')!=0)
  532.         {
  533.                 strcpy(#anchor, #URL+strrchr(#URL, '#'));
  534.                 URL[strrchr(#URL, '#')-1] = 0x00;
  535.         }
  536.  
  537.         if (!strncmp(#URL,"mailto:", 7))
  538.         {
  539.                 notify(#URL);
  540.                 strcpy(#editURL, history.current());
  541.                 strcpy(#URL, history.current());
  542.                 return;
  543.         }
  544.  
  545.         if (!strncmp(#URL,"https://",8))
  546.         {
  547.                 notify("'HTTPS protocol is not supported yet' -E");    
  548.         }
  549.        
  550.         GetAbsoluteURL(#URL);
  551.  
  552.         if (strncmp(#URL,"http://",7)!=0)
  553.         {
  554.                 if (UrlExtIs(".htm")!=true) && (UrlExtIs(".html")!=true)
  555.                 {      
  556.                         RunProgram("/sys/@open", #URL);
  557.                         strcpy(#editURL, history.current());
  558.                         strcpy(#URL, history.current());
  559.                         return;
  560.                 }
  561.         }
  562.         else   
  563.         {
  564.                 if (UrlExtIs(".png")==true) || (UrlExtIs(".gif")==true) || (UrlExtIs(".jpg")==true)
  565.                 || (UrlExtIs(".zip")==true) || (UrlExtIs(".kex")==true)
  566.                 || (UrlExtIs(".7z")==true) || (UrlExtIs("netcfg")==true) {             
  567.                         strcpy(#downloader_edit, #URL);
  568.                         CreateThread(#Downloader,#downloader_stak+4092);
  569.                         strcpy(#editURL, history.current());
  570.                         strcpy(#URL, history.current());
  571.                         return;
  572.                 }
  573.         }
  574.         OpenPage();
  575. }
  576.  
  577. stop: