chrome snippets

How to add OpenSearch to your Rails app

Tagged opensearch, search, firefox, chrome  Languages ruby

Add an action:

def opensearch
    # fixes Firefox "Firefox could not download the search plugin from:"
    response.headers["Content-Type"] = 'application/opensearchdescription+xml'
    render :layout => false

Create the template opensearch.erb:

<?xml version="1.0" encoding="UTF-8"?> 
<OpenSearchDescription xmlns=""> 
  <Description>YerWebberSite search</Description> 
  <Tags>secks, drogs, rocken roll</Tags> 
  <Image width="16" height="16"></Image> 
  <moz:SearchForm ""/>
  <Url type="text/html"

Add the autodiscovery tag inside the head tag:

<link href='/opensearch.xml' rel='search' title='YerWebberSite search' type='application/opensearchdescription+xml'>

Problems? Read the documentation and troubleshooting tips.

How to edit HTML inline in Google Chrome

Tagged html, edit, chrome  Languages 

How to edit HTML inline in Google Chrome:

# open the Chrome console # click on the Elements pane # select the html or body element # click on the Console pane # execute this snippet in the Console pane

$0.contentEditable = true

Congratulations, you can now edit the text by first clicking on it.