Tag Archives: Domínio

Chrome – How to clean cache, cookies and local storage for a specific domain

And here is one more post from the special series: “How it could be so simple?”. Actually, this is the first one, but such situations are so common in my routine that I will start to write more about this.

What inspired me to write this article, despite the hint, is how I found the solution. I had to clean cache, cookies and local databases from a specific domain on Chrome, of course, keeping other domains untouched. After 1 minute looking at Chrome config page, I quit and went to the web for some research. After another minute, I’ve found incredible forum posts, even in stackexchange, from guys asking for extensions to do it. Wait a minute. Is that a kind of basic goal too hard to reach?

I’ve stopped, think and… voilá! It’s a quite simple fellows:

On the page you want to clean cache, click right mouse button on a “free area” and select the “View page info” option.

View page info

On the options’ screen, select the “Show cookies and site data”:

Show cookies and site data

And then you might see this:

Cookies set by this page

On this screen, you can access to all domain data, from cookies to websql storage. Easy!

And all this happened just because I had to erase a simple local sqlite on my ripple emulator. 🙂

VBA – Validação de Domínios

Tudo bem, este código é valido para qualquer linguagem, já que utiliza uma API existente no Windows, a URLMON.dll.

O código abaixo disponibiliza uma função para validar um domínio de Internet ou URI. Em tempo:

Em TI, um Identificador Uniforme de Recursos (URI) (Uniform Resource Identifier (em inglês)) é uma cadeia de caracteres compacta usada para identificar ou denominar um recurso na Internet. O principal propósito desta identificação é permitir a interação com representações do recurso através de uma rede, tipicamente a Rede Mundial, usando protocolos  específicos. URIs são identificadas em grupos definindo uma sintaxe específica e protocolos associados.

(fonte: WikiPedia)

Option Explicit
Private Const S_FALSE = &H1
Private Const S_OK = &H0
Private Declare Function IsValidURL Lib "URLMON.DLL" (ByVal pbc As Long, ByVal szURL As String, ByVal dwReserved As Long) As Long
 
Function IsGoodURL(ByVal sURL As String) As Boolean
    'The IsValidURL always expects a UNICODE string, but whenever
    'VB calls an API function, it converts the strings to ANSI strings.
    'That's why we're going to use a trick here. Before calling the function,
    'We're going to convert the unicode string to unicode so we get a double
    'unicode string.
    'Before VB calls the API function, it converts our double unicode string
    'to a normal unicode string; exactely what IsValidURL is expecting.
    sURL = StrConv(sURL, vbUnicode)
    'Now call the function
    IsGoodURL = (IsValidURL(ByVal 0&, sURL, 0) = S_OK)
End Function

Mantive os comentários do autor para evidenciar a autoria. Para testar o código, basta colocar em uma célula qualquer a chamada da função desta forma:

=IsGoodURL(“http://www.tomasvasquez.com.br”)

O código tem algumas limitações, como exigir a existência do “http://” em todo domínio a ser validado.

Referências

http://msdn.microsoft.com/en-us/library/ms775112%28VS.85%29.aspx
http://www.vbforums.com/showthread.php?t=611648

Bom proveito!