Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
browser_stack_button
Advanced tools
BrowserStackButton adds a button to your page to allow you to quickly and easily view the page you are looking at in BrowserStack. It is currently set up to work on a Rails project but could probably be used in Sinatra or the like.
Add this line to your application's Gemfile:
gem 'browser_stack_button'
And then execute:
$ bundle
Or install it yourself as:
$ gem install browser_stack_button
Put your configuration in an initializer:
config/initializers/browser_stack_button.rb
BrowserStackButton.configure do |config|
# ...
end
By default BrowserStackButton will not render any buttons for any browsers. You need to set them up as described below. Refer to the Browser Stack API documentation for what each setting means.
These options are applied to all browsers, but can be overridden by the individual browser settings.
config.default_options = {
os: "Windows",
start: "true",
speed: "2",
zoom_to_fit: "false",
resolution: "1024x768",
full_screen: "true",
}
config.browsers["IE8"] = { browser: "IE", browser_version: "8.0", os_version: "7" }
config.browsers["IE9"] = { browser: "IE", browser_version: "9.0", os_version: "7" }
config.browsers["IE10"] = { browser: "IE", browser_version: "10.0+Desktop", os_version: "8" }
config.browsers["Firefox"] = { browser: "Firefox", browser_version: "22.0", os_version: "7" }
config.browsers["Safari"] = { browser: "Safari", browser_version: "6.0", os: "OS X", os_version: "Mountain Lion" }
config.browsers["Chrome"] = { browser: "Chrome", browser_version: "28.0", os_version: "7" }
Add the following just after your opening <body>
tag:
<%= browser_stack_button %>
If you want to enable it, likely only on a staging server, you can call
call BrowserStackButton.enable!
in a before_filter
or in your controller
action if you want to enable it in the current Rails environment.
You could enable it on production for just admin users or whatever you like. We only use it on our staging server.
Sometimes you need to add additional parameters to your site url that is
visited by BrowserStack. We use this for a login backdoor on our staging server
which allows us to view the page as the same user we are currently logged in
as. To do this, pass an additional hash to enable!
:
BrowserStackButton.enable! do |button|
# Add additional params to the url
if user_signed_in?
button.url_params[:backdoor] = current_user.email
else
button.url_params[:backdoor] = "anonymous"
end
# OR override the URL entirely
browser.url = "http://example.com"
end
Once enabled, you should see a BrowserStack logo in the top left of the page. Click it to reveal a dropdown and select a browser. You will need to enable popups. When changing browsers, it is best to close the previous browser window before clicking the next one.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that browser_stack_button demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.