Subversion Repositories Kolibri OS

Rev

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