Subversion Repositories Kolibri OS

Rev

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